lumberjack icon indicating copy to clipboard operation
lumberjack copied to clipboard

[question] How lumberjack works when there is a shutdown ?

Open cmarmonier opened this issue 1 year ago • 1 comments

Hello,

For my application, I use "lumberjack.v2" with zerolog on Linux embedded system.

Sometime, my application needs to shutdown the system.

In this case, how can I ensure that my log files are not corrupted? How does it work when the Linux stop command is executed? In my application, how can I block writing and know when current writes are finished?

Also, how can I do when power supply stops?

cmarmonier avatar Oct 13 '23 07:10 cmarmonier

Looks like you want some way to call Sync() on the file or open the file with O_SYNC.

dveeden avatar Nov 21 '23 13:11 dveeden