How to log message of kern.emerg using syslogd ?

Posted on 2009-04-27
Last Modified: 2013-12-27
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

Question by:beer9
    LVL 38

    Expert Comment

    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.


    Author Comment

    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                                      *
    mark.*                                          /dev/console

    Open in new window

    LVL 22

    Accepted Solution

    There actually isn't anyway to specify the kernel facility with the logger command. The syslog library call looks to see if a facility is given and if not, it substitutes "user". As it happens the "kernel" facility is facility 0, which the library call interprets as "none". I don't know if that is by accident or design, but either way, you can't do it with logger, or any other user land program that calls syslog from the c library.

    Author Closing Comment

    Thanks blu! :-)

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. Please see for the updated article. It is avail…
    Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
    This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now