next up previous
Next: logMessage Utility Reference Up: APS logDaemon and Client Previous: Client Library Reference

logDaemon Reference

Command line options:

logDaemon
[-m (text|SDDS)] Log file format. This option only available if SDDS compiled in.
[-i $<$serviceId$>$] Text name for logDaemon. Defaults if not given.
[-f $<$config file name$>$] Configuration file name. Defaults to log.confg (see -e option).
[-p $<$UDP port$>$] UDP port for daemon to listen on. Defaults if not given.
[-r] Remove any current log files at startup, and start with fresh ones.
[-h $<$home dir$>$] Use this directory for log files. Defaults to current dir.
[-o $<$save dir$>$] Use this directory for saved log files. Defaults to ./save.
[-s $<$max size$>$] Copy a log file to save dir if it exceeds this size (in bytes).
[-e] Print example of a config file to stdout.

Environment Variables (corresponds to above options in general):

LOG_SERVER_ID
LOG_PORT
LOG_CONFIG
LOG_HOME
LOG_SAVEDIR
LOG_MAXSIZE

A configuration file (log.config) is read at startup time (and anytime a kill -HUP is issued). This file is not required, but does allow you to redirect log messages to particular files based on various combinations of tag values. You may also specify email destinations.

In the absence of a log.config file, each unique sourceId is given its own log file. By default, the file is titled $<$sourceId$>$.log.

A sample config file (log.config) is as follows:

#Example log.config file
#-----------------------
# Fields are ~ separated, and as follows:
# sourceId~dest~destName~<tag1>=<val1>~<tagn>=<valn>
# where sourceId is string
#       dest is the string log or mail
#       destName is a log file name if dest is log,
#         or space delimited list of email addrs if
#         dest is mail.
#       <tag1>=<val1> specifies that tag value supplied
#         in message must match <val1> exactly. Any
#         tag names not given will match anything.
# Specify three log files for msgs from IOC sourceId
IOC~log~iocLogMinor.log~severity=Minor
IOC~log~iocLogMajor.log~severity=Major
IOC~log~iocLogOther.log
# Next, specify email for msg from any sourceId DOOM
DOOM~mail~me@aps.anl.gov you@aps.anl.gov

Any incoming log message is matched against this data. If the incoming sourceId matches a line in the config file, then each subsequent incoming tag value will be matched against that specified in the file. If a tag name is not given in a config file line, a match is assumed. All complete matches result in either a log file being written, or an email being sent.

The logDaemon records any new incoming sourceId/tagList combination from logOpen() calls. Once a sourceId/tagList is submitted, you may not redefine it without deleting the corresponding line in the log.sourceId file and restarting the daemon. Note that the server will remember sourceId/tagList associations across invocations.


next up previous
Next: logMessage Utility Reference Up: APS logDaemon and Client Previous: Client Library Reference
Robert Soliday 2005-05-02