[logback-user] Delete log file in runtime and slf4j+logback doesnt create it again

David Roussel nabble at diroussel.xsmail.com
Sat Apr 12 00:37:10 CEST 2014


I can tell you are using unix as on windows you would not be able to delete the file while is is open. 

On unix one process deleting a file does not actually delete it, but just removes it from the directory listing. Any other processes with the file open are not notified and the file still exists until the file is closed. 

You could write some custom code to monitor the directory and check the file still exists and re link it.  But it sounds kinda tricky. And it's the kind of unixy stuff that is hard to do in java. Please someone correct me if I'm wrong. 

Your not the first person to ask this question. So if someone knows how to implement what I suggested. (At least a pointer in the right directio). Please let me know. 


> On 11 Apr 2014, at 00:35, Raghu Prabhudeva <prabhudeva.raghu at gmail.com> wrote:
> Hi,
> Im facing this problem while using version 1.0.13 of logback.
> "Delete log file in runtime and slf4j+logback doesnt create it again"
> Can you please suggest some way of resolving this issue.
> Thanks
> Raghu
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/logback-user

More information about the Logback-user mailing list