зеркало из https://github.com/microsoft/docker.git
Merge pull request #33832 from glasser/glasser/msg-source
Fix stderr logging for journald and syslog
This commit is contained in:
Коммит
7843bfde36
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче