Closed pankajsoni19 closed 3 years ago
the simplest way is
logConfig.Output = Logger.Std(log.InfoLevel, nil, "", stdLog.LstdFlags).Writer()
But a formal way is you should write a structured style logger
like https://github.com/phuslu/log/issues/22
I saw FileWriter
it implements io.Writer
. I just used fileWriter without the async wrapper.
logConfig := middleware.DefaultLoggerConfig
logConfig.Output = global.Logger.Writer.(*log.FileWriter)
e.Use(middleware.LoggerWithConfig(logConfig))
Yes, it's also works. except it directly write plan text output nor structured output to writer.
I am on echo v4
Error is