zap
zap copied to clipboard
how to display console recovery log with RecoveryWithZap()
Hi, When I use default gin.Recovery(), I can set display error into console and write log file:
gin.DefaultErrorWriter = io.MultiWriter(logger, os.Stderr)
r.Use(gin.Recovery())
Now,When I use RecoveryWithZap(), it will only write log into the zap logger file,how to display console recovery log too?
Thanks, Best Wishes.
@smallmenu maybe you can setup a dedicated logger for the recovery middleware to use
- https://github.com/uber-go/zap/issues/586
- https://stackoverflow.com/questions/50933936/zap-logger-print-both-to-console-and-to-log-file