lumberjack icon indicating copy to clipboard operation
lumberjack copied to clipboard

Simultaneous log access

Open dbboyd17 opened this issue 5 years ago • 2 comments

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.

dbboyd17 avatar Apr 18 '19 12:04 dbboyd17

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.

natefinch avatar Apr 18 '19 12:04 natefinch

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

WhileLoop avatar Jun 27 '19 06:06 WhileLoop