Merge pull request #427 from thaJeztah/19.03_backport_40232-comply_with_gelf_spec

[19.03 backport] logger/gelf: Skip empty lines to comply with spec
This commit is contained in:
Sebastiaan van Stijn 2020-01-16 21:09:12 +01:00 committed by GitHub
commit cf14fa7a23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -166,6 +166,10 @@ func newGELFUDPWriter(address string, info logger.Info) (gelf.Writer, error) {
}
func (s *gelfLogger) Log(msg *logger.Message) error {
if len(msg.Line) == 0 {
return nil
}
level := gelf.LOG_INFO
if msg.Source == "stderr" {
level = gelf.LOG_ERR