plog
plog copied to clipboard
Does writing logs from multiple processes to the same log file at the same time cause problems
Does writing logs from multiple processes to the same log file at the same time cause problems
Writing to the same file from multiple processes is atomic and cause no issues.
What's problematic is log rotation as it requires inter-process synchronization. Also different processes may have different log rotation parameters. So if you do not use log rotation everything will be fine.
Writing to the same file from multiple processes is atomic and cause no issues.
What's problematic is log rotation as it requires inter-process synchronization. Also different processes may have different log rotation parameters. So if you do not use log rotation everything will be fine.
What if I set the same log rotation parameters for all my processes,one process write fast ,the other one write slow, will they rotate at the same time?
@liuhao123t No, it won't work as there is no inter-process synchronization. So they may start rotating at the same time, or one after another.
Writing to the same file from multiple processes is atomic and cause no issues.
What's problematic is log rotation as it requires inter-process synchronization. Also different processes may have different log rotation parameters. So if you do not use log rotation everything will be fine.
How to disable log rotation?
How to disable log rotation?
It's disabled by default. Unless you set log files number and log file max size.