-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability save logs to file #17
Comments
try this: lecho.New(&lumberjack.Logger{
Filename: "/var/log/myapp/foo.log",
MaxSize: 500, // megabytes
MaxBackups: 3,
MaxAge: 28, //days
Compress: true, // disabled by default
}) |
Hi @ziflex looking at integrating with an existing Echo app with zerolog and checking if you have plans to integrate the multple output (Stdout, consoleWriter, File)
See docs: I will take a look at lumberjack example, thanks |
Hey @rrajkowski, You should be able to do this with the existing API. lecho.New(zerolog.MultiLevelWriter(consoleWriter, os.Stdout)) lecho.From(zerolog.New(zerolog.MultiLevelWriter(consoleWriter, os.Stdout))) lecho.Middleware(lecho.Config{
Logger: lecho.New(zerolog.MultiLevelWriter(consoleWriter, os.Stdout)),
}) |
@ziflex thanks for the reply. I was able to implement the MultiLevelWriter. I am writting to Stdout and file. I've tried the following:
Ideally I can update or modify the logger context with response for a single stdout/file log. Let me know and I can move this to a new issue Thanks |
Hi,
Is lecho have ability to save logs to file with *.log extension?
The text was updated successfully, but these errors were encountered: