Softpanorama
(slightly skeptical) Open Source Software Educational Society

May the source be with you, but remember the KISS principle ;-)

Google   


Logger - Sending Messages to a System Log File

News See also Recommended Links Recommended Articles Messages Classification Configuration examples AIX syslog

The logger command enables you to send messages to the syslogd daemon. The syntax  is:

logger [ -i ] [ -f file ] [ -p priority ] [ -t tag ] [ message ]

where:

You can specify the message priority as a facility.level pair. For example, -p local3.info assigns the message priority of the info level in the local3 facility.

The default priority is user.notice.

Therefore, the following example logs the message System rebooted to the syslogd daemon, using the default priority level notice and the facility user:

# logger System rebooted

If the user.notice selector field is configured in the /etc/syslog.conf file, the message is logged to the file designated for the user.notice selector field.

If the user.notice selector field is not configured in the /etc/syslog.conf file, you can either add the user.notice selector field to the /etc/syslog.conf file, or you can prioritize the output as follows:

# logger -p user.err System rebooted

Changing the priority of the message to user.err routes the message to the /var/adm/messages file as indicated in the /etc/syslog.conf file. A message priority can also be specified numerically.

For example, logger -i -p2 "crit" creates an entry in the message log that identifies the user.crit-facility.level pair as follows:

Nov 3 09:49:34 hostname root[2838]: [ID 702911 user.crit] crit

Old News ;-)

Recommended Links


In case of broken links please try to use Google search. If you find the page please notify us about new location
Google     

 

 

 


Copyright © 1996-2008 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. Submit comments This document is an industrial compilation designed and created exclusively for educational use and is placed under the copyright of the Open Content License(OPL). Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

Standard disclaimer: The statements, views and opinions presented on this web page are those of the author and are not endorsed by, nor do they necessarily reflect, the opinions of the author present and former employers, SDNP or any other organization the author may be associated with. We do not warrant the correctness of the information provided or its fitness for any purpose.

Last modified: June 05, 2008