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

capnslog: set SYSLOG_IDENTIFIER for journal #43

Merged
merged 1 commit into from
Oct 24, 2015

Conversation

jonboulle
Copy link
Contributor

Fixes #40. I think it's reasonable to just set this by default rather than
needing to expose it to users.

References:
http://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html#SYSLOG_FACILITY=
http://linux.die.net/man/3/program_invocation_short_name

@@ -55,7 +55,8 @@ func (j *journaldFormatter) Format(pkg string, l LogLevel, _ int, entries ...int
}
msg := fmt.Sprint(entries...)
tags := map[string]string{
"PACKAGE": pkg,
"PACKAGE": pkg,
"SYSLOG_IDENTIFIER": os.Args[0],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basename()

@jonboulle
Copy link
Contributor Author

updayted

@crawford
Copy link
Contributor

LGTM

jonboulle added a commit that referenced this pull request Oct 24, 2015
capnslog: set SYSLOG_IDENTIFIER for journal
@jonboulle jonboulle merged commit a57ea4f into coreos:master Oct 24, 2015
@mischief
Copy link
Contributor

might it be better to use https://github.com/kardianos/osext for this?

@jonboulle
Copy link
Contributor Author

Maybe it would be better to use /proc/self/exe, but I'd rather not import
that whole library - the journal logging should only ever happen on Linux
so we don't need the cross platform abstraction. File a patch?

On Sat, Oct 24, 2015 at 3:44 PM, Nick Owens notifications@github.com
wrote:

might it be better to use https://github.com/kardianos/osext for this?


Reply to this email directly or view it on GitHub
#43 (comment).

jonboulle added a commit to jonboulle/etcd that referenced this pull request Nov 6, 2015
Update to catch coreos/pkg#43 which should fix SYSLOG_IDENTIFIER getting
set when etcd is logging to the journal.
jonboulle added a commit to jonboulle/etcd that referenced this pull request Nov 9, 2015
Update to catch coreos/pkg#43 which should fix SYSLOG_IDENTIFIER getting
set when etcd is logging to the journal.
yichengq pushed a commit to yichengq/etcd that referenced this pull request Nov 19, 2015
Update to catch coreos/pkg#43 which should fix SYSLOG_IDENTIFIER getting
set when etcd is logging to the journal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants