You are here: Administration > Man Pages > lk_log(8)

lk_log(8)

NAME

lk_log(8) — manage and display log files

SYNOPSIS

LKROOT/bin/lk_logmgr [-d defaults] [-l logdir]

LKROOT/bin/lk_log [-f] [-t tail] [-l logdir] [log]

DESCRIPTION

These commands manage and display a registered set of log files. LifeKeeper automatically registers the following seven log files (stored at LKROOT/out):

log

This log contains information regarding the management of LifeKeeper protected applications and LifeKeeper resources. Additionally, information generated by the application's remove and restore scripts are stored in this log. Finally, major LifeKeeper events like stopping and starting LifeKeeper, service and failover operations are recorded in this log.

LCM

This log contains information specific to the LCD program. TCP Comm Path events and program state changes are recorded in this log.

LCD

This log contains information specific to the LCD program. Information regarding the LifeKeeper database and program state changes are recorded in this log.

TTYLCM

This log contains information specific to the TTYLCM program. TTY CommPath events and program state changes are recorded in this log.

remote execute

This log is a record of all remote LifeKeeper requests.

GUI

This log contains information specific to the GUI server program.  Information regarding GUI server connections, events, and program state changes are recorded in this log.

SNMP

This log contains information about SNMP traps that  are  sent when  certain LifeKeeper  events occur. Each trap sent to a management node is recorded  in this log.

NOTIFY

This log contains information about email notifications that  are sent  when  certain LifeKeeper  events occur.  The subject of each email notification is recorded in this log.

 

The lk_logmgr program parses the specified defaults file for the list of supported logs. The syntax in the defaults file is as follows:

LOGFILE=LogName(LogSize)

where LogName is the base name of the log file (i.e., LCM) and LogSize is the size of the log file in 512-byte blocks. A list of multiple logs may be specified by entering multiple LOGFILE keywords. The target directory for the log files in this list is specified by the logdir argument. The lk_logmgr program guarantees a new log message is recorded by using two techniques.  First, the program pre-allocates the space necessary to hold LogSize amount of data which insulates LifeKeeper against file system exhaustion. Second, log files are implemented as circular queues which causes old messages to be replaced by new ones. This action prevents LifeKeeper from being the one that causes file system exhaustion. The log files should be sized to hold several days worth of log messages. The LogSize parameter can be changed at any time and the lk_logmgr program will automatically adjust the log file to the new size when the system is rebooted.

The lk_log program is used to report the list of logs registered with the log manager and to display the contents of a specific log file. Information is written into the log using the LifeKeeper log or pl commands [see prfuncs(5)], traditional shell redirection (e.g., >>/opt/LifeKeeper/out/log), or C program interfaces (e.g., open("/opt/LifeKeeper/out/log",O_APPEND)).  All these interfaces work whether the log manager is active or not. If the log manager is inactive, the log information is stored in a flat file that is automatically transferred to the circular queue when the log manager is active again.

SYNTAX

lk_logmgr [-d defaults] [-l logdir]

The log manager program is normally invoked at boot time via an entry in the /etc/inittab file. The -d option specifies the location of the file that contains a list of LOGFILE keywords, and defaults to /etc/default/LifeKeeper.  The -l option specifies the target directory that contains the log files, and defaults to $LKROOT/out if not specified.

lk_log [-l logdir]

This command displays a list of all logs registered with the log manager.  The -l option specifies the target directory that contains the log files, and defaults to $LKROOT/out if not specified.

lk_log [-f] [-t tail] [-l logdir] log

This command displays the contents of the specified log. The -l option specifies the target directory that contains the log files, and defaults to$LKROOT/out if not specified. The default operation of this command is to display the entire log and exit. The -f option prevents the command from exiting, causing it to display new information that is recorded in the log.  The -t option restricts the report to the last tail lines of information. Both options are analogous to those in the tail command.

EXAMPLES

/opt/LifeKeeper/bin/lk_log log >/tmp/log

Dumps entire contents of log into a temporary file.

/opt/LifeKeeper/bin/lk_log -t 10 log

Displays the last ten lines of the log.

/opt/LifeKeeper/bin/lk_log -t 0 -f log

Displays new log information as it becomes available.

EXIT CODES

0 is returned if the command is successful, otherwise 1 is returned and an error message is displayed on the stderr stream.

NOTES

The location of this utility, LKROOT, is defined in the default file /etc/default/LifeKeeper.

FILES

/etc/default/LifeKeeper

$LKROOT/out/log

$LKROOT/out/.log

$LKROOT/out/.admin

CAVEATS

If an application (or shell script) has an open file descriptor to the log file, and the log manager terminates, then the subsequent log message generates a SIGPIPE signal.

© 2012 SIOS Technology Corp., the industry's leading provider of business continuity solutions, data replication for continuous data protection.