Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add pid to Logging msg #43

wants to merge 1 commit into from

Conversation

Thuener
Copy link

@Thuener Thuener commented Aug 19, 2016

closes #42

@kmsquire
Copy link
Owner

Seems reasonable to me, although I don't use syslog logging right now.

@sbchisholm, since you added syslog support, any comments?

@DanielArndt
Copy link
Collaborator

@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)

@DanielArndt
Copy link
Collaborator

(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...)
Copy link
Collaborator

@sbchisholm sbchisholm Aug 22, 2016

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?

@DanielArndt
Copy link
Collaborator

@sbchisholm You just had to prove me wrong, didn't you :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add pid in Logging msg for multithread
4 participants