-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pid to Logging msg #43
base: master
Are you sure you want to change the base?
Conversation
Seems reasonable to me, although I don't use syslog logging right now. @sbchisholm, since you added syslog support, any comments? |
@kmsquire Might be a couple days before he gets around to this. @sbchisholm and I have been pulled away from the Julia world recently (unfortunately) and he's caught up with some other things right now (just a heads up) |
(and I'd provide any useful feedback if I had any, but I do not :) ) |
@@ -78,7 +78,7 @@ function log(syslog::SysLog, level::LogLevel, color::Symbol, logger_name::Abstra | |||
# syslog needs a timestamp in the form: YYYY-MM-DDTHH:MM:SS-TZ:TZ | |||
t = time() | |||
timestamp = string(Libc.strftime("%Y-%m-%dT%H:%M:%S",t), Libc.strftime("%z",t)[1:end-2], ":", Libc.strftime("%z",t)[end-1:end]) | |||
logstring = string("<", (UInt16(syslog.facility) << 3) + UInt16(level), ">1 ", timestamp, " ", syslog.machine, " ", syslog.user, " - - - ", level, ":", logger_name,":", msg...) | |||
logstring = string("<", (UInt16(syslog.facility) << 3) + UInt16(level), ">1 ", timestamp, " ", syslog.machine, " ", syslog.user, " - - - ", level, ":", logger_name,":",getpid(),":", msg...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The string " - - - "
, the first of these three placeholders is for the PROCID according to here: https://tools.ietf.org/html/rfc5424#section-6.5 (see example 2). Would it make more sense to use this?
@sbchisholm You just had to prove me wrong, didn't you :D |
closes #42