in reply to Re^2: log level in modules
in thread log level in modules

use fork() to create threads

fork doesn't create threads*, it creates new processes which are copies of the parent. You're only sending the signal the parent process, so nothing changes the copies of the logger objects found in the child processes.

Even if you did create threads, Perl gives each thread a copy of every Perl variable except for variables that had been shared explicitly. You didn't create a shared variable that holds a logger object, and I doubt that the logger does this for you.

* — Except in Windows. fork is emulated using threads in Windows.

Replies are listed 'Best First'.
Re^4: log level in modules
by Anonymous Monk on Aug 21, 2009 at 18:11 UTC

    My apologies if "thread" was the incorrect term. Yes, I'm aware of what happens when fork() is used. Part of the signal handler is to pass on the signal to all the children (copies).

    As stated in the original post, there is no problem with changing the logging level for the parent or children (copies). The change in logging level is reflected in all these entities. It's the modules that don't want to cooperate.

      So why do you think it has anything to do with forking? The problem occurs entirely inside each process from what you now say.

      So why do you think it has anything to do with signals?

      So far, all you've told us is

      Changing the log level of $logger doesn't affect the logging level in the logger returned by get_logger

      And I'm here asking "And....?"

      It seems your problem could be recreated in 5 lines. Why didn't you post these?

        I'm confused. Are you trying to help or get off on some power trip?

        I ask questions here because I know someone has the answer. But it never fails: ask a simple question and you get asked for your life story. Ask a question with context then people worry about everything but the question.

        If you know why get_logger isn't getting the modified logger, great! Tell me.

        If you know how to fix my problem, great! Tell me.

        If you're trying to give constructive feedback on my post so I can better ask any future questions, your failing.