Skip to content

Uncentralized output makes integration complicated #798

@awfm9

Description

@awfm9

One thing I never understood and was hoping to see fixed in version 3 was the usage of different output streams. I don't quite understand the rationale, maybe someone can elaborate? Why do we have three different output sources, stdLogger, Color and HTTPErrorLogger?

In our use case, we really fit echo into microservices for those that expose a REST API, but the rest of the microservices use the same framework. This means that echo should submit to our architecture, not the other way around. This works great in most cases, but is a bit painful for logging. At this point, we work around it like this:

log := ourown.NewLogger()

server := echo.New()
server.Logger.SetOutput(ioutil.Discard)
server.Color.SetOutput(ioutil.Discard)
server.HTTPErrorHandler = custom.Error
server.Use(custom.Logger(log))

I see the point of potentially having different logs for requests and the rest of the messages, but I think there should be at most two output streams, where one of them can easily capture everything, and another one might just go to the HTTP clients as the responses.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions