How can my file appender deal with disappearing log files?
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.
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.