Solved

Where do syslog messages come from?

Posted on 2007-03-30
2
199 Views
Last Modified: 2013-12-16
Experts:

I am trying to learn about syslog (and syslog-ng).  I have a question:  Where do the log messages come from?  Does the kernel just spew messages all the time?  If logging is not configured, do the messages just go nowhere?  Does the programmer of a particular program decide the severity level (warn, info, etc) or does the system somehow classify the messages?  

For instance, as a programmer, can I just arbitrarily decide to send a log message classified as, say, daemon.warn?  Or am I limited to what types of messages I can send.  How would a program actually send a log message?  Would it use the "logger" command?

Thanks,
Tnic
Memphis TN
0
Comment
Question by:tayloenic
2 Comments
 
LVL 25

Expert Comment

by:Cyclops3590
ID: 18826030
0
 
LVL 48

Accepted Solution

by:
Tintin earned 125 total points
ID: 18834042
Lots of questions there.

1.  Log messages come from any program that does it's logging via syslog function call or via the command line 'logger' command.

2.  The Kernel will send out a variety of syslog messages. It depends on your syslog.conf configuration as to how much is actually recorded in log files.

3.  If syslogd is not running, or the syslog message doesn't match any of the syslog.conf entries, then it effectively gets binned.

4.  It's up to the programmer to decide what messages are debug, critical, notice, info etc.

5.  A programmer can use whatever facility and notice level they like for logging.  However, it is not a good idea to mix your logging with the standard existing syslog facilities.  LOCAL0 to LOCAL6 are reserved for custom apps, so you can log via them to keep the app logs separate from everything else.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

856 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