KCML uses the Unix syslog to log warnings, error messages and auditing information. Messages can also be reported by applications using the WRITE LOG statement or, for shell scripts, the kwritelog utility. In exceptional circumstances KClient will directly raise log messages on its server's syslog.
KCML: ERROR /usr/local/kcml/kcml[fred,31854]: Dumping program state to file /user1/app/panics/panic31854.xmlFrom build 22236 of KCML 6.20 & 7.15 (or later) a Universally Unique Identifier (UUID) will be included in the syslog message too.
KCML: ERROR /usr/local/kcml/kcml[fred,f3e7ea2e-a543-460c-b404-fd482665c27c,31854]: Dumping program state to file /user1/app/panics/panic31854.xml
For KCML processes this is the same UUID that is stored in the process's entry in $PSTAT.
A configuration entry in this file is composed of two TAB-separated fields, one for the selector and one for the action. The selector field contains a semicolon-separated list of priority specifications of the form facility.level where facility is a system facility, or comma-separated list of facilities, and level is the minimum severity of the condition being logged. There are a number of built in codes such as kern, mail, etc. KCML 6 uses the local1 and local2 facility codes, while KCML 5 uses the user facility code for their messages. The facility symbol * can be used to represent all facilities and the level none means do not send messages from the indicated facility to the selected file. So for example, a selector of *.debug;mail.none will send all messages except mail messages to the selected file.
The action field indicates where to forward the message. Values for this field can have various forms of which only two are relevant to a KCML site, viz:
A KCML site could use
local1.info;local2.info;user.info /var/adm/log/kcml.log
to pick up all KCML messages.
To get KClient dumps it should log
*.debug /var/adm/log/debug.log
For more about syslog configuration see the man page for syslogd on your system. Many Linux systems now use enhanced versions of syslog:
# KCML system log messages local1.info;local2.info;user.info /var/log/kcml.log
is the preferred alternative to changing /etc/rsyslog.conf directly.
Modern versions of syslog-ng also support configuration fragments from a /etc/syslog-ng/conf.d directory.
For example, creating /etc/syslog-ng/conf.d/kcml.conf with the contents:-
# syslog-ng equivalent of
#local2.notice /var/log/kcmlaudit.log
#local1.info;local2.notice /var/log/kcml.log
filter f_kcmlaudit { level(notice) and facility(local2) };
filter f_kcmllog { level(notice) and facility(local2) or level(info) and facility(local1) };
destination kcmlaudit { file("/var/log/kcmlaudit.log" suppress(30) perm(0644)); };
log { source(src); source(chroots); filter(f_kcmlaudit); destination(kcmlaudit); };
destination kcmllog { file("/var/log/kcml.log" suppress(30) perm(0644)); };
log { source(src); source(chroots); filter(f_kcmllog); destination(kcmllog); };
# KCML system log messages local1.info;local2.info /var/log/kcml.log local2.notice /var/log/kcmlaudit.log
As logs get bigger with time you may need rotate the logs.
The method of log rotation is dependent on the type of Unix system.
AIX5 specifies additional keywords for /etc/syslog.conf that control the rotation, and optional backup, of log files.
Many Linux implementations use logrotate to manage many operating system log files. The list of syslog files is usually stored in /etc/logrotate.d/syslog.
Other Unix systems could use a cron script to accomplish log rotation.
See also: