Skip to content

log.Logger should be a interface instead of a struct #14205

Closed
@owenthereal

Description

@owenthereal

What version of Go are you using (go version)?

1.5.3.

What operating system and processor architecture are you using?

Linux. AMD 64.

What did you do?

We've been using logrus for structural logging which is good for querying and stuff. And we would like httputil.ReverseProxy.ErrorLog to log in the same format as logrus which is used in the application code. Since log.Logger is a struct instead of a interface, there's no way to adapt logrus to log.Logger.

What did you expect to see?

I would expect log.Logger to be a interface which defines a bunch of methods, e,g. Fatal(v ...interface{}) and allow different implementations. This way, even the Go standard library can log in same way as application code.

What did you see instead?

Well, log.Logger is a struct and the log format is different from our application code. We need to have other ways to query the log for stdlib.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions