DFlogger

DFlogger — Re-route error messages from non-DFdiscover applications to syslog, which in turn writes the messages to the system log files, as configured in /etc/syslog.conf.

Synopsis

DFlogger [-t string] [-f string] {-s #}

Description

DFlogger reads the standard input, or the file specified with -f string, treating each input line as an error message to be forwarded to syslog.

DFlogger should be used, in a pipeline fashion, at the end of commands that might generate error messages that you want to record in the system error log. DFlogger sends each input line to syslog and counts how many lines were written. The number of lines is used as the exit status of DFlogger. This has the benefit that, if DFlogger is used at the end of a pipeline, the exit status of the pipelined command will always be the number of error messages generated.

Options

-t string

the name of the program that DFlogger should prepend each message with. This is the program name that will appear in the header information for the message when it is written to the error log. The default is DFlogger.

-f string

the name of a file that contains error messages to be sent to the error log. Each line of the file is assumed to be an individual error message. If this option is not provided input is assumed to come from the standard input.

-s #

the DFdiscover study number (required).

Exit Status

DFlogger exits with one of the following statuses:

36

The required command-line arguments were not present or were incorrectly specified.

> 0

The command was successful. The exit status is the number of input lines that were transferred to syslog.

Examples

Example 3.58. Capture any error output from to the system error log

% DFtiff2ras /tmp/TIFFfile /tmp/rasterfile_ 2>&1 | \
DFlogger -t DFtiff2ras

Both the standard output and standard error are directed to DFlogger (this is C-shell syntax).