Logging

Logging is an insight into what DBMail is doing. From a simple audit log, to investigating potential bugs, logs offer a permanent record.

Out of the box you get defaults that work for most installations, they're useful for most organisations so you probably won't need to change them. They can be easily configured with dbmail.conf.

DBMail has a lot of information about everything it does, and you can turn the level of logging up or down as required. The new settings take effect as soon as you restart the service.

There are two settings, syslog and filelog, to filter what gets logged. You probably want the minimum most important information in the system log and more details in the file log.

Logging defaults:

  • syslog = warning
  • logfile = notice

The default location for the log file is /var/log/dbmail/dbmail.log though you can easily change it and you can also have separate log files for each service.

[DBMAIL]
file_logging_levels       = notice
syslog_logging_levels     = warning
logfile = /var/log/dbmail/dbmail-lmtpd.log

If you wanted to log debug information for the LMTP daemon, just add the following to the configuration file.

[LMTP]
file_logging_levels = debug
logfile = /var/log/dbmail/dbmail-lmtpd.log

After restarting the daemon all logging at or lower than debug will go to /var/log/dbmail/dbmail-lmtpd.log

Logging levels from lowest to highest:

  • Emergency
  • Alert
  • Critical
  • Error
  • Warning
  • Notice
  • Info
  • Debug
  • Database