Skip to content

Logger from the standard library is not correctly disabled. #10251

Closed
@ph

Description

I've seen a report where a keep alive TCP connection received some garbage from the remote end, since we didn't have anything configured to handle that request the http client did just log the error directly using the default logger. Since beats was running as a service the log went to stdout/stderr and was dump to the /var/log/message, This is indeed an unexpected behavior.

The following code is not exactly what it need to be. We have to setup ioutil.Discard when the catch all selector * is not set or stdlog is not set. When either of the selector is defined we need to use our logger output.

beats/libbeat/logp/core.go

Lines 101 to 105 in 4cb9bd7

if _, enabled := selectors["stdlog"]; !enabled {
// Disable standard logging by default (this is sometimes used by
// libraries and we don't want their spam).
golog.SetOutput(ioutil.Discard)
}

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions