Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Log4perl is not writing into the log file when log file contents are cleared

by gam3 (Curate)
on Jan 05, 2010 at 18:40 UTC ( #815799=note: print w/ replies, xml ) Need Help??


in reply to Log4perl is not writing into the log file when log file contents are cleared

It is likely that logrotate is unlinking the file. In Unix this does not delete the file, but only the directory entry. Since you keep the file open you keep writing to it. If you are not compressing the file you should be able to tail the logfile.1 file and see that your logging is still going to that file.

To solve this problem you can either have logrotate do a copytruncate or have you program close (and open) the log when it gets a SIGHUP and set prorotate to send a HUP to your program.

-- gam3
A picture is worth a thousand words, but takes 200K.


Comment on Re: Log4perl is not writing into the log file when log file contents are cleared

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://815799]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2014-07-12 02:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (238 votes), past polls