easyloggingpp
easyloggingpp copied to clipboard
Reopen log file after logrotate
When using logrotate to limit log file size in a linux system I cannot get easyloggingpp to reopen the log file after it has been rotated.
I've tried to just do Logger::reconfigure()
but seems that is not enough.
Then I tried Helpers::validateFileRolling()
but I call it after the file has been rotated so it will not do the fs->close() fs->open()
.
Any idea how to do this?
After a little investigation I found that log files seem to be open due to a shared_ptr is never releasing the FileStream object and hence the file is never closed.
I made a fix here: https://github.com/muflihun/easyloggingpp/pull/595
Why is this important repair not integrated?
I had the same problem when using Logger::reconfigure()