Tuesday, July 13, 2010

logadm: Log Administration

The logadm utility can handle pretty much any application's log files for us. By using copy,truncate and compression features, we aren't forced to restart each application when we cycle the logs, especially with apache,tomcat and other web applications log files tend to get too large to maintain and is required to be monitored at all times..
logadm ends up giving us a huge amount of control over our log files, without having to write and maintain shell scripts.
 

Every solaris build environment has already a root crontab entry for logadm utility and it reads off a configuration file in /etc/logadm.conf

The configuration file already monitors and maintains existing /var/adm system administration log files eg, syslog, messages log , etc

Running the following command we want to keep 1 copy of the log and we want to cycle when it reaches 1gb , copy and truncate them (without restarting any service), compress a copy of the log file and write an entry into the /etc/logadm.conf


 logadm -C 1 -s 1g -c -z 0 -w /usr/local/apache2.2/logs/error_log




No comments:

Post a Comment