Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recovery deleted log files at logback worked fine on Windows but didn't work on Linux SUSE

I using SLF4J + logback 1.0.12 for my application logging infrastruction. I run my application on both Windows XP and Linux SUSE os. I have a scenario as following:

I deleted log files when my application is running. On Windows XP logback recovery mechanism worked fine and after passing some seconds (about 10 seconds) log files generate again but on Linux SUSE log files don't generate again.

My question is : Why logback recovery mechanism has different behavior on two os?

like image 498
Sam Avatar asked Nov 29 '25 09:11

Sam


1 Answers

Under Linux, if a process writes to a file and the target file is removed, the process continues to quietly write to a ghost file. The error condition does not trigger an exception.

This answers why the recovery process behavior depends on the OS.

like image 50
Ceki Avatar answered Dec 01 '25 22:12

Ceki