Link to home
Start Free TrialLog in
Avatar of beer9
beer9Flag for India

asked on

How to log message of kern.emerg using syslogd ?

I am typing the below command using 'logger' but I do not see kern.emerg priority I can see user.emerg priority instead. Could someone please let me know the reason behind this anomaly. Thanks!
logger -t genunix -p kern.emerg "pm0 is /pseudo/pm@0"
 
#tail -1 /var/adm/messages
Apr 28 05:27:10 sun10 genunix: [ID 702911 user.emerg] pm0 is /pseudo/pm@0

Open in new window

Avatar of yuzh
yuzh

By default, your syslog.conf file looks like:
kern.emerg           *
This means "Kernel emergency messages are forwarded to all logged-in users." which make sense in most case.
If you write the emergency messages to a file, eg /var/adm/messages, the trade off is the the users who are currently login will not see the warming messages on their screens.

 
Avatar of beer9

ASKER

below is the output from my /etc/syslog.conf file. My only concern is when I execute my command

logger -t genunix -p kern.emerg "pm0 is /pseudo/pm@0"

then instead of getting the kern.emerg why I am getting user.emerg in /var/adm/messages. Thanks!

Also what is '/dev/sysmsg' device?
bash-3.00# cat /etc/syslog.conf 
#ident  "@(#)syslog.conf        1.5     98/12/14 SMI"   /* SunOS 5.0 */
#
# Copyright (c) 1991-1998 by Sun Microsystems, Inc.
# All rights reserved.
#
# syslog configuration file.
#
# This file is processed by m4 so be careful to quote (`') names
# that match m4 reserved words.  Also, within ifdef's, arguments
# containing commas must be quoted.
#
*.err;kern.notice;auth.notice                   /dev/sysmsg
*.err;kern.debug;daemon.notice;mail.crit        /var/adm/messages
 
*.alert;kern.err;daemon.err                     operator
*.alert                                         root
 
*.emerg                                         *
 
# if a non-loghost machine chooses to have authentication messages
# sent to the loghost machine, un-comment out the following line:
#auth.notice                    ifdef(`LOGHOST', /var/log/authlog, @loghost)
 
mail.debug                      ifdef(`LOGHOST', /var/log/syslog, @loghost)
 
#
# non-loghost machines will use the following lines to cause "user"
# log messages to be logged locally.
#
ifdef(`LOGHOST', ,
user.err                                        /dev/sysmsg
user.err                                        /var/adm/messages
user.alert                                      `root, operator'
user.emerg                                      *
)
 
mail.info                                       /var/adm/maillog
mark.*                                          /dev/console

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Brian Utterback
Brian Utterback
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of beer9

ASKER

Thanks blu! :-)