Merge pull request #33832 from glasser/glasser/msg-source

Fix stderr logging for journald and syslog
This commit is contained in:
Brian Goff 2017-06-27 13:30:41 -04:00 committed by GitHub
commit 7843bfde36
2 changed files with 4 additions and 2 deletions

View File

@ -112,9 +112,10 @@ func (s *journald) Log(msg *logger.Message) error {
}
line := string(msg.Line)
source := msg.Source
logger.PutMessage(msg)
if msg.Source == "stderr" {
if source == "stderr" {
return journal.Send(line, journal.PriErr, vars)
}
return journal.Send(line, journal.PriInfo, vars)

View File

@ -133,8 +133,9 @@ func New(info logger.Info) (logger.Logger, error) {
func (s *syslogger) Log(msg *logger.Message) error {
line := string(msg.Line)
source := msg.Source
logger.PutMessage(msg)
if msg.Source == "stderr" {
if source == "stderr" {
return s.writer.Err(line)
}
return s.writer.Info(line)