As you can see, trying to delete the file itself becomes a very OS specific thing:
shailendra sharma wrote:
As windows acquire locks over the file being in use but this is not the case with linux.
and i delete my log file after execution of statement 1 and before execution of statement 2 .. then what will happen on the execution of the secong debug statement ..a new file will be created or exception will be thrown ..
From what i have experienced in log4j, this kind of thing can really lead to all kinds of side effects - to the extent of no more logs being written out to the file unless you restart the logging system.