MEONMedical / Log4Qt

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

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

Closed chehrlic closed 7 years ago

chehrlic commented 7 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 7 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 7 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 7 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 7 years ago

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