LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Syslogd logging severity levels (https://www.linuxquestions.org/questions/linux-server-73/syslogd-logging-severity-levels-548469/)

endfx 04-23-2007 10:00 PM

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.

druuna 04-24-2007 03:12 PM

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.

endfx 04-25-2007 10:11 AM

Thanks, druuna. I thought of that but unfortunately some of the levels need to be in the same log file.

druuna 04-25-2007 10:28 AM

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.


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