in reply to Re: log level in modules
in thread log level in modules
OK, some clarification:
If we ignore the changing of log levels, everything works as expected.
And here is the program flow:
program start -> initialize logger <<Log::Log4perl::init("log.properti +es")>> -> get the logger <<my $logger = get_logger()>> -> use fork() +to create threads -> wait for threads to die
child start -> change NDC <<Log::Log4perl::NDC->push($NDC)>> -> do the +ir thing, including using customer modules
The modules use my $logger = get_logger() to get the logger. Messages from the modules use the correct NDC as configured for each thread.
Let's say my module is as simple as:
use Log::Log4perl (get_logger); my $logger = get_logger(); sub sayHello { $logger->info("Hello world!"); }
Doesn't that mean that every time a thread executes that sayHello sub, the module gets the logger then logs a message?
If so, why doesn't it get the new logging level? If I start with level WARN specified in my config file, I don't expect to see the message in my logs. That part works just fine. If I then use the signal to lower the level to INFO, I would expect to see the message start appearing in the log. It doesn't.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: log level in modules
by ikegami (Patriarch) on Aug 21, 2009 at 17:55 UTC | |
by Anonymous Monk on Aug 21, 2009 at 18:11 UTC | |
by ikegami (Patriarch) on Aug 21, 2009 at 19:06 UTC | |
by Anonymous Monk on Aug 22, 2009 at 00:39 UTC | |
by ikegami (Patriarch) on Aug 22, 2009 at 03:32 UTC | |
|