syslog problems

2007-12-25 9:11:00

Hi all. I asked a question regarding why the following command wouldn't

work with my /etc/syslog.conf:

# logger -p kern.debug test-info

It turns out that apparently logger can't generate a kern.debug message.

Also, after creating an /etc/syslog.conf that simply contains the

following line:

kern.debug /var/adm/messages

and starting '/usr/sbin/syslogd -d', no info was sent to the file. While

'dmesg' produced the desired results, the previous did not. I rebooted,

and it worked fine.

I have also worked on porting `logrotate' from my RH Linux box, and

another kind Solaris admin improved on my work. It uses a configuration

file, /etc/logrotate.conf, which allows you specify parameters such as:

# Compress log files after rotation

compress

# Rotate daily

daily

# Only rotate if greater than 500k

size 500k

As well as `functions' to define the specific properties of log files:

/var/adm/messages {

        size 100k

        nocompress

        postrotate

                ps -ef | grep syslogd | awk '{print $2}' | xargs kill -HUP

        endrotate

}

etc, etc... If you'd like a copy, point your browser to:

http://nic.com/~dave/

Perhaps you could mail me and mention you find it useful, and perhaps I'll

turn it into a package...

The following is a very effective /etc/syslog.conf file for me:

#

# /etc/syslog.conf -- This file controls the logging of system

information.

# This typically is generated by the OS system daemons.

#

# January 11, 1999

#

# o A configuration entry is composed of two TAB seperated fields:

#

# selector action

#

# o A `selector' consists of `facility.level'. The levels available are,

# in ascending order of severity:

#

# (Least information)

# emerg - For panic conditions

# alert - Immediate attention necessary

# crit - Critical warnings, such as disk failure

# err - General error

# warning - Warning messages

# notice - Not error conditions, but require special

# attention

# info - Informational messages

# debug - Normally used when debugging problems

# (Most information)

#

# none - Disable a particular facility

#

# o See the man page for syslog.conf(4) for a description of facility and

# level. See syslogd(1M) for instructions on using the daemon.

#

# o These files must already exist, as they will not automatically be

# created.

#

# This is currently configured to log notice level or higher. See also

# the /etc/logrotate.conf file for information on rotating logs

#

# These control the types of log data this host controls. Change from

# `undefine' to `define' in order to enable.

define(`LOGHOST')

undefine(`POPLOG')

# Send another copy of all data to normal /var/adm/messages file.

*.err;kern.debug;daemon.notice;mail.crit;user.none /var/adm/messages

# Log all kernel messages to the console.

kern.notice /dev/console

# Log all kernel events, including NFS and other network problems,

# driver info, serious kernel problems, etc.

kern.debug /var/log/kern.log

# Keep track of all mail sent and retrieved by this system.

mail.info /var/log/mail.log

# Log daemon problems and events, such as POP, telnet, ftp, etc.

daemon.info

/var/log/daemon.log

# Send all POP mail requests to a seperate file.

#

# If the POPLOG environment variable is defined, data will go to the

# /var/log/POP.log file, otherwise local0.debug data will go to the

# /var/log/debug.log file.

#

# Define POPLOG=1 at the top of this file to enable this feature

#

local0.debug

ifdef(`POPLOG',`/var/log/POP.log',`/var/log/debug.log')

# Log all authentication and other security events, including failed

# login, su attempts, getty, etc

auth.info /var/log/auth.log

# Messages generated by user processes

user.info /var/log/user.log

# Log all cron events, and especially watch for failures

cron.info /var/log/cron.log

# Everyone should get a copy of emergency messages

*.emerg *

# Save mail, news, and lpr messages of level err or higher

uucp.err;lpr.err;news.err /var/log/spooler.log

# Uncomment this line for full debugging. This is useful for

troubleshooting

# difficult problems

#*.debug /var/log/debug.log

Thanks to:

Shaun O'Connor <soc@ms.com>

Stephen Harris <sweh@mpn.com>

Francois Leclerc <leclerc@austin.apc.slb.com>

Benedetto Lo Giudice <benlog@xep0.estec.esa.nl>

Casper Dik <casper@holland.Sun.COM>

(Thomas Anders) <anders@hmi.de>

Arthur Rossiter <AROSSITE@us.oracle.com>

Comments

Got something to say?

You must be logged in to post a comment.