---
name: "log2mail"
section: "8"
platform: "linux"
package: "log2mail"
version: "0.3.0-2.1"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/log2mail"
---

# log2mail(8)

## NAME

log2mail runs as a daemon matching patterns in files and sending mail if a match occurs

## SYNOPSIS

**log2mail** **\[-**N**\]** **\[-**R**\]** **\[-**l**\]** \[**-f** *config-file*\]

**log2mail** **-**V

**log2mail** **-**h

## DESCRIPTION

*log2mail* is configured by a config file (see below). It matches each line added to a given file against patterns for this file and sends mail to a named recepient,  if the pattern matches. Because of limitations to the select()-system call, log2mail scans files every second. Log2mail waits a number of seconds before it'll send a message, and if this specific pattern is matched again, it waits another number of seconds, specified like the first one in the config file.

log2mail runs as a daemon (if started without the -N option, see below).  In daemon mode, log2mail logs using the syslog DAEMON facility  (/var/log/daemon.log in Debian).

## OPTIONS

- \-h

  display a short help and exit

- \-V

  display version information and exit

- \-N

  do not fork into background, log to STDERR

- \-l

  write a log entry for every mail message sent

- \-R

  read directory recursive in config dir

- \-f config-file

  use *config-file* instead of the default /etc/log2mail.conf. You may specify  a directory instead of a file: All files in the directory will be read (without reasonable exceptions, see source). See [log2mail.conf(5)](/log2mail.conf/5.md) for a description of the format.

## FILES

*/etc/log2mail.conf*

a message template file

## HINTS

To increase the amount of information printed by log2mail, compile with the DEBUG option (see source code).

## AUTHOR

Michael Krax \<mk-log2mail@krax.net\>

## SEE ALSO

**regex** (7), **log2mail.conf** (5)
