Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can my file appender deal with disappearing log files?

0
Posted

How can my file appender deal with disappearing log files?

0

The file appender that comes with Log4perl, Log::Log4perl::Appender::File, will open a specified log file at initialization time and will keep writing to it via a file handle. In case the associated file goes way, messages written by a long-running process will still be written to the file handle. In case the file has been moved to a different location on the same file system, the writer will keep writing to it under the new filename. In case the file has been removed from the file system, the log messages will end up in nowhere land. This is not a bug in Log4perl, this is how Unix works. There is no error message in this case, because the writer has no idea that the file handle is not associated with a visible file.

0

The file appender that comes with Log4perl, the Log::Log4perl::Appender::File manpage, will open a specified log file at initialization time and will keep writing to it via a file handle. In case the associated file goes way, messages written by a long-running process will still be written to the file handle. In case the file has been moved to a different location on the same file system, the writer will keep writing to it under the new filename. In case the file has been removed from the file system, the log messages will end up in nowhere land. This is not a bug in Log4perl, this is how Unix works. There is no error message in this case, because the writer has no idea that the file handle is not associated with a visible file.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123