natefinch / lumberjack

lumberjack is a log rolling package for Go
MIT License
4.79k stars 591 forks source link

Simultaneous log access #85

Open dbboyd17 opened 5 years ago

dbboyd17 commented 5 years ago

Hi. Can you clarify the statement "Lumberjack assumes that only one process is writing to the output files. Using the same lumberjack configuration from multiple processes on the same machine will result in improper behavior."

Does this mean that only one goroutine within an executable can use log.Write, or that only one executable can write to any particular file?

Thank you.

natefinch commented 5 years ago

Lumberjack is goroutine / threadsafe but it's not safe to have two running processes (executables) writing to the same logfile, because tracking the size of the file is done in-memory.

WhileLoop commented 5 years ago

@natefinch Does this mean I can safely have multiple instances of lumberjack. Logger with the same Filename?