natefinch / lumberjack

lumberjack is a log rolling package for Go
MIT License
4.81k stars 593 forks source link

Multiprocess environment #166

Closed Small-World closed 2 years ago

Small-World commented 2 years ago

hello,Does lumberjack support multiple processes, and whether each process needs to use a different file path

natefinch commented 2 years ago

It doesn't support multiple processes. Since lumberjack keeps an in-memory record of how large the file is, if you have two processes writing to the same file, it would have an inaccurate record of the size of the file. You can absolutely have two processes writing to two different files, though. And in general I think that's a better solution anyway.

Small-World commented 2 years ago

ok,thank you