Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://815799]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (8)
As of 2024-04-18 08:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found