Closed Wzshun closed 3 years ago
I don't think that the log4qt library can ensure that the last log entry is written if the application crashes.
"QSaveFile is an I/O device for writing text and binary files, without losing existing data if the writing operation fails" -> QSaveFile does only protect existing data.
I use
DailyFileAppender
to write log, but when my program crashed or something broken, it can't see the latest log in file after restart program or reboot.(here is embedded Linux).The
WriteAppender
useQTextStream::flush
when immediateFlush is true, but it seems that it just only write it's internal buffer to filesystem.Is there any something like
QSaveFile
which commit() save data to file? In fact, it call native sync method, which callfsync
in linux.Thanks in advance.