We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Write
Close
package main import ( "gopkg.in/natefinch/lumberjack.v2" "log" "time" ) func main() { lj := &lumberjack.Logger{ Filename: "test.log", MaxSize: 5, // megabytes MaxBackups: 3, } if err := lj.Close(); err != nil { panic(err) } log.SetOutput(lj) go func() { for { log.Println(time.Now().Format(time.RFC3339Nano)) } }() time.Sleep(time.Second * 3) }
I believe there should be no content in test.log, as the file was closed before writing. But it turns out the Close method has no effect on Logger
Logger
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I believe there should be no content in test.log, as the file was closed before writing. But it turns out the
Close
method has no effect onLogger
The text was updated successfully, but these errors were encountered: