Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: [log4perl] log level vs. threads

by menth0l (Monk)
on Aug 31, 2011 at 11:11 UTC ( #923400=note: print w/ replies, xml ) Need Help??


in reply to Re: [log4perl] log level vs. threads
in thread [log4perl] log level vs. threads

Thanks for your suggestions. I want change log levels dynamically via xmlrpc to view detailed output when my app behaves in unexpected way. Now, i think i'll see what signals can offer me...


Comment on Re^2: [log4perl] log level vs. threads
Replies are listed 'Best First'.
Re^3: [log4perl] log level vs. threads
by Old_Gray_Bear (Bishop) on Aug 31, 2011 at 11:51 UTC
    As chrestomanci has pointed out, Log4Perl already has the functionality built in to determine if the configuration file has changed between logging calls.

    So, just adjust the default log-level and rewrite the file. The change will flow naturally from there. No need to be mucking with the additional complication of cross-thread communications....

    ----
    I Go Back to Sleep, Now.

    OGB

      The solution of watching a log file doesn't work of course if you choose to write your config options in the code versus a configuration file. What I found to work is to explicitly call the init() function to re-initialize after making the changes you desire to the config options. The catch is that this must be done within each thread. I wrote a little about this here: http://andydeese.wordpress.com/

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://923400]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (11)
As of 2015-07-28 23:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls