Created
September 11, 2015 22:44
-
-
Save dayvonjersen/569034c01a71ec41e8dd to your computer and use it in GitHub Desktop.
Write your program's logs to their own file in /var/log with rsyslog
This file contains hidden or 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
# In order to have your log messages which you wrote to syslog | |
# e.g. with go's log/syslog package: | |
# | |
# import ( | |
# "log" | |
# "log/syslog" | |
# ) | |
# //... | |
# if syslogw, err := syslog.New(syslog.LOG_NOTICE, "myprog"); err == nil { | |
# log.SetOutput(syslogw) | |
# } | |
# | |
# You can then have rsyslog write these messages to their own file(!) in /var/log | |
# You know, like a real, ~professional~ program would: | |
:programname, isequal, "myprog" /var/log/myprog.log | |
# peace, love and respect to: | |
# http://technosophos.com/2013/09/14/using-gos-built-logger-log-syslog.html | |
# http://unix.stackexchange.com/a/37235 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment