Nate Finch

Results 207 comments of Nate Finch

Write a meg of data, change your computer clock. (note: v3 will let you do fine-grained size and max age settings, to make that easier)

Truncate and append don't make any sense together. Truncate truncates, there's nothing to append to. You said "when logrotate to rotate the log file" ... if lumberjack is writing to...

I mean, yeah, don't delete the file. This is probably something we could handle, and recreate it, though.

This was intentionally removed in v2, because if you screw up the nameformat, the filenames won't be unique, and everything will go to hell in a weird way.

Hi Matt! This is a tricky one. This sounds like something that should be addressed for v3, which uses a constructor method specifically to do some sanity checks on startup....

Lumberjack will copy the permissions of the existing file when it creates the new file. See here: https://github.com/natefinch/lumberjack/blob/v3/lumberjack.go#L267 So if you want different file permissions, the easiest thing to do...

If you create the file in your own code with the right permissions, lumberjack will copy those permissions to the new file when it rolls over. It creates the file...

What would it do if the file already exists with different permissions? Would it try to change the permissions on the existing file? If not, would it use the existing...

That's correct, but I'll make sure to document it.

I made similar changes in the v3 branch. I'm not sure that maxsize = -1 is a good idea? Is there some other way you'd be managing file size?