Created
December 3, 2014 22:14
-
-
Save ioggstream/cdf3c40135a70d13c73c to your computer and use it in GitHub Desktop.
Use rsyslog to separate log levels (eg. for twisted apps)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cat /etc/rsyslog.d/20-test.conf | |
# Define a new template to trace syslogseverity | |
$template TwistedTmpl,"%TIMESTAMP% %syslogtag% %syslogseverity-text%:%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" | |
# Then split critical, error, warning, notice in test-rsyslog... | |
if $programname == 'twisted' and $syslogseverity <= 4 then /var/log/test-rsyslog.log;TwistedTmpl | |
& ~ | |
# and debug, info in test-rsyslog-debug | |
if $programname == 'twisted' and $syslogseverity > 4 then /var/log/test-rsyslog-debug.log;TwistedTmpl | |
## Uncomment the following to stop logging anything that matches the last rule. | |
## normally containing kern.* messages (eg, /var/log/kern.log) | |
& ~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment