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.
In reply to Re^2: log level in modules
by Anonymous Monk
in thread log level in modules
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |