Skip Menu |

This queue is for tickets about the Log-Log4perl CPAN distribution.

Report information
The Basics
Id: 94877
Status: resolved
Priority: 0/
Queue: Log-Log4perl

People
Owner: Nobody in particular
Requestors: dmcbride [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Initialization warning "Forgot to call init()?" although initialized and logging
I get the following message: Log4perl: Seems like no initialization happened. Forgot to call init()? So far, this sounds like 77003. However, the difference is that I know that the initialization happened because I've been logging stuff all along. The problem seems to be that during global cleanup, some of my DESTROY functions want to trace things, but this happens after Log4perl has already had its END functions called, and thus the ROOT_LOGGER is gone. That's when the message shows up - during cleanup. I'm not entirely sure what can/should be done about this, but the warning is definitely misleading/wrong. The fact that the loggers are all now invalid and thus trace points could be lost is important information, but I'm not sure if a warning that can't be turned off is the way to go here. Better might be to not delete the ROOT_LOGGER as part of END and just let it get cleaned up on its own. Not sure.
On Sat Apr 19 10:02:58 2014, DMCBRIDE wrote: Show quoted text
> The problem seems to be that during global cleanup, some of my DESTROY > functions want to trace things
Yeah, after Log4perl has cleaned up, its loggers are unusable, any attempt to use them will result in the (arguably confusing) error message. Best way to avoid this is to stack the END handlers correctly, similar issue with Win32 and open file handles: http://search.cpan.org/dist/Log-Log4perl/lib/Log/Log4perl/FAQ.pm#Why_doesn't_my_END_handler_remove_my_log_file_on_Win32?