-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
Description
Description
I noticed that recently a change has been made to middleware.LoggerConfig. So, we cannot specify the Format, and instead, we can only specify the Fields. This is breaking my service and my logging stack due to the fact that I need to rename some of the fields. For example, I need to rename time to timestamp because my other services are logging timestamp.
Checklist
- Dependencies installed
- No typos
- Searched existing issues and docs
Expected behaviour
I would like to specify the format for middleware logger.
Actual behaviour
I can only specify the fields for middleware logger.
Steps to reproduce
The following does not work anymore:
e.Use(middleware.LoggerWithConfig(middleware.LoggerConfig{
Format: {"level":"INFO","res":{"statusCode":${status}},"req":{"method":"${method}","url":"${uri}","remote_addr":"${remote_ip}"},"responseTime":${latency},"timestamp":"${time_rfc3339}","message":"HTTP ${method} ${uri}"}
}))