Zap logger #2586
Unanswered
SebastianStehle
asked this question in
Q&A
Zap logger
#2586
Replies: 1 comment
-
You are better off not using You can check other loggers implementations how they implement Echo Logger interface. For example this is Zerolog implementation https://github.com/ziflex/lecho/blob/master/logger.go Internally Echo uses only few methods from that interface:
Example: func main() {
e := echo.New()
s := http.Server{
Addr: ":8080",
Handler: e,
// and other handy fields to configure timeout etc
}
if err := s.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {
log.Fatal(err)
}
}
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Has someone already implemented the logger interface using zap?
I am so confused about the signature of the logger interface with all the methods like SetLevel, SetOutput and so on.
Beta Was this translation helpful? Give feedback.
All reactions