LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-23-2007, 10:00 PM   #1
endfx
Member
 
Registered: May 2003
Location: Canada
Distribution: Debian
Posts: 105

Rep: Reputation: 15
Syslogd logging severity levels


Is there any way to get syslog to include the severity level to the messages it writes to log files?

Thanks.
 
Old 04-24-2007, 03:12 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Not that I know of. You could send every level to separate files (next to what you are already having). Add something like this to your /etc/syslog.conf (and restart syslogd afterwards):
Code:
# ------------------------------------------------------------------ #
# All levels in a seperate file
*.emerg                         -/var/log/log.0_emergency
*.alert;*.!emerg                -/var/log/log.1_alert
*.crit;*.!alert                 -/var/log/log.2_critical
*.err;*.!crit                   -/var/log/log.3_error
*.warning;*.!err                -/var/log/log.4_warning
*.notice;*.!warning             -/var/log/log.5_notice
*.info;*.!notice                -/var/log/log.6_info
*.debug;*.!info                 -/var/log/log.7_debug
Hope this helps.
 
Old 04-25-2007, 10:11 AM   #3
endfx
Member
 
Registered: May 2003
Location: Canada
Distribution: Debian
Posts: 105

Original Poster
Rep: Reputation: 15
Thanks, druuna. I thought of that but unfortunately some of the levels need to be in the same log file.
 
Old 04-25-2007, 10:28 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

You only need to combine some of the lines to do that. If you don't know how: syslog.conf's manpage has an example of that, or take a look here

Here's one to get you going:

*.=info;*.=notice /var/log/log.5-6-info-notice => All info and notice messages to one file.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why won't my FC3 rc0 and rc6 levels not call kill script when entering those levels? dvkwiatk Linux - General 2 11-11-2006 08:09 AM
syslogd logging questsion plan9 Slackware 2 09-03-2004 04:23 PM
syslogd ????????????????????? lub0 Linux - General 2 09-23-2003 08:17 AM
using red-carpet without logging out and logging as root. packman Linux - Software 1 12-09-2002 02:55 AM
logging external messages with syslogd slawomir Linux - Networking 3 09-04-2002 04:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration