Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #95 from andrewhsu/fix-logging
Browse files Browse the repository at this point in the history
[17.06] Fix stderr logging for journald and syslog
  • Loading branch information
andrewhsu authored Jul 12, 2017
2 parents 7a50b06 + bac91bd commit 2d8beb7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion components/engine/daemon/logger/journald/journald.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion components/engine/daemon/logger/syslog/syslog.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2d8beb7

Please sign in to comment.