MEONMedical / Log4Qt

Log4Qt - Logging for the Qt cross-platform application framework
Apache License 2.0
580 stars 234 forks source link

Rollingfileappender: Roll file on startup if appendFile is false #28

Closed chehrlic closed 6 years ago

chehrlic commented 6 years ago

When appendFile is set to false (which is the default), the RollingFileAppender did not roll the current log file which results in an unexpected logdata loss.

chehrlic commented 6 years ago

Imo it's a bug in log4j/log4cxx since it does unexpected things. But if you don't like it I would ask you to make at least openFile() virtual so I can create a custom appender.

andibacher commented 6 years ago

If I think more about this case, you might right that this is a bug in log4j too, at least an unexpected behavior. I will accept the patch. thank you.

chehrlic commented 6 years ago

Thx for the quick response. I managed to check the log4cxx behavior - it really overwrites the logfile instead rolling. So the new/different behavior should be at least documented.

andibacher commented 6 years ago

I documented the behavior change in the "Changes Differences to Log4j" section and in the ChangeLog.