Reputation: 5943
I usually clear log files when I'm in developement mode and I need to have a fresh start to focus only on things I have to test.
If I clear a log file in linux (have not tested Windows), logback stops to write to that file Maybe it's something about open handlers and file descriptors in linux.
How can I recover the situation without restarting the application? Is it possibile to have an appender that can automatically recover this situation?
Upvotes: 1
Views: 749
Reputation: 47895
While your application is running (and Logback within your application has an open handle to the log file) ...
There's an open issue against Logback requesting a change in Logback's behaviour in this situation.
If you goal here is to have log output which focusses on recent-activity-only then you could define a rolling file appender with a minimal size and no history just to retain the (for example) last 1MB of data, this might help offer some focus on recent events only.
Alternatively, you'll have to:
Upvotes: 2