SMA Custom Logging

Custom log format (clog) is one of the output formatting options. Unlike ASCII and HTML, which are reporting formats, clog is a sort of log file filter. It's main function is to convert the multi-line sendmail log file to a simple, one-line-per-delivery format. This simple log file may then be further analysed with another log analyzer, for example the excellent analog (anyone interested in writing analog configuration for SMA?).

Custom logging is invoked with command line option (-O clog) and/or configured using the following configuration file keywords:

Format clog
ClogFormat FORMATSTRING

The value FORMATSTRING controls the information and how it is formatted. It consists of ordinary characters and various two-character sequencies which are replaced with built-in variables as follows:

For example, the following format string
  ClogFormat	"%D: from=%f, to=%t, size=%z"
looks at the output side like
  Thu Oct 25 04:24:56 2001: from=sender1, to=recipient1, size=10
  Thu Oct 25 04:24:57 2001: from=sender2, to=recipient2, size=20
  Thu Oct 25 04:24:58 2001: from=sender3, to=recipient3 size=30
Unlike ASCII and HTML, Custom logging is done in real-time and it runs with a very small memory footprint. Piping the output of running sendmail daemon might be a very interesting application:
$ tail -f /var/log/maillog | sma -O clog

Back to SMA home page Home