logger

logger - Accumulating parsed data

logger command accumulate parsed data in a temporary log file which ware created by mailboxparser command into each regular log file by date. The temporary log file which was created by mailboxparser is a temporay file, and it will be created every time the mailboxparser command is started. logger command read all the temporary log files and accumulate the parsed data into the regular log file by date. This command has been installed in INSTALL-DESTINATION/bin directory.

Usage

An Accumulated log file will be saved in a directory which defined at etc/bouncehammer.cf by running logger command. Available options are displayed by --help option.

Concatenate temporary log files (created by mailboxparser) by date # logger -c
 
List the number of temporary log files which will be dealt by logger command
# logger --list
12
 
Concatenate and accumulate the specified temporary log file into the regular log file by date
# logger -c /tmp/hammer.2011-02-11.4c482d32.001008.tmp
 
Merge and accumulate the temporary files in the specified directory into the regular file by date
# logger -m /var/tmp/logs/
 
Print help messages
# logger --help

Available Options

Options for Log Writing

-c, --concatenate
Temporary log files (include parsed data created by mailboxparser) are accumulated by logger command. logger command with this option will create a regular log file by date in a directory which is defined at etc/bouncehammer.cf . A user who execute logger command should have permissions to write the log directory.

Note that this option concatenates the temporary log file into the regular log file by date. If logger command deal the temporary log file multiple times, there will be duplicated records in the regular log file.
-m, --merge (Beginning with ver.2.2.0)
logger command with this option will create a regular log file by date in a directory which is defined at etc/bouncehammer.cf . A user who execute logger command should have permissions to write the log directory.

Note that this option merge the temporary log file into the regular log file by date. This option will take longer (all the duplicated records are removed) than -c,--concatenate option.
-l, --list
This option reports the number of temporary log files which will be dealt with logger command, in var/spool directory (defined at etc/bouncehammer.cf). This option may not be useful.

Options for Temporary Log Files

--truncate
After accumulating, truncate temporary log files(size=0).
--remove
After accumulating, remove temporary log files.
--backup Directory Name (Beginning with ver.2.2.0)
After accumulating, Temporary log files are moved to a specified directory.

Other Options

-B, --batch (Beginning with ver.2.3.1)
Runs as a batch mode. Results of the command will be displayed as YAML format. It useful to send the results to an administrator with an email.
-C, --conf /path/to/configuration file
Use an alternative bounceHammer's configuration file. If this option is omitted, the command will use INSTALL-DESTINATION/etc/bouncehammer.cf .
-T, --test
Runs as test mode. This option is equals to the option -C INSTALL-DESTINATION/etc/test-run.cf .
--silent (Beginning with ver.2.1.0)
Turn silent mode on. This option makes the command quiet in spite of -v, --verbose option (described later). And when the command is called from a daemon (such as sendmail), the command will exit with status 0 in spite of an error. If an MTA process (e.g. /usr/sbin/sendmail) which is called the command without this --silent option stopped by an error, the command will exit with status 75(EX_TEMPFAIL).
-v, --verbose
Turn verbose mode ON.
--help
Display help messages of this command.
--version
Display the version number of this command.

Screenshot of the running command

logger -vvvvv -c --batch --remove

The following screenshot shows that logger command concatenate temporary log files into regular log files by date.

No TrackBacks

TrackBack URL: http://bouncehammer.jp/cgi-bin/mt/mt-tb.cgi/109

Leave a comment