docs(README): updated example
This commit is contained in:
parent
d095180eb4
commit
6dca2d6522
@ -12,7 +12,8 @@ Just a simple zerolog based request logging http middleware. It also sets a `X-R
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
handler := logginghandler.Handler(http.HandlerFunc(myHandler))
|
logger := log.With().Logger()
|
||||||
|
handler := logginghandler.Handler(logger)(http.HandlerFunc(myHandler))
|
||||||
http.Handle("/", handler)
|
http.Handle("/", handler)
|
||||||
log.Fatal().Msg(http.ListenAndServe(":5000", nil).Error())
|
log.Fatal().Msg(http.ListenAndServe(":5000", nil).Error())
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user