Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: log4perl question

by andreychek (Parson)
on Sep 17, 2003 at 14:05 UTC ( #292119=note: print w/ replies, xml ) Need Help??

in reply to log4perl question


At a glance, the code in your conf file looks good. I think you're being bitten by another issue -- basically, whenever Log4perl sends a message off to your newpingdata Logger, it additionally will give that message to every other logger in the heirarchy, including your rootLogger.

The exact problem and solution were discussed in-depth, including examples, in this node on Log4perl. To summarize, you can tell a logger not to send messages up the heirarchy using additivity. You can also tell a given appender not to accept log messages below a certain log level by using threshold. And of course, there are filters and other goodies, but I don't think you need to go that far for your current problem.

So, check out the above node, and also look up those terms in Log4perl's documentation. Good luck!


Lucy: "What happens if you practice the piano for 20 years and then end up not being rich and famous?"
Schroeder: "The joy is in the playing."

Comment on Re: log4perl question
Replies are listed 'Best First'.
Re: Re: log4perl question
by leriksen (Curate) on Sep 18, 2003 at 00:42 UTC
    And that is why recently I started to not even have a root logger - to avoid the double logging that you mention.
    I did this as an experiment with some code I am writing now - and it seems to work fabulously well
    # set your logger here # Note - no root logger - this is not always what you want # but at this early stage of developement, is good enough #log4perl.logger=INFO, A1 log4perl.logger.WSR_Generator._create_wsr_document=INFO, A1 #log4perl.logger.WSR_Utils.form_order=DEBUG, A1 #log4perl.logger.WSR_New_Worker_Return.create_wsr_records=DEBUG, A1 #configure SCREEN logger log4perl.appender.A1=Log::Dispatch::Screen log4perl.appender.A1.min_level=debug log4perl.appender.A1.stderr=1 log4perl.appender.A1.layout=Log::Log4perl::Layout::PatternLayout log4perl.appender.A1.layout.ConversionPattern=%d %-5.5p - %M - %m%n
Re: Re: log4perl question
by chimni (Pilgrim) on Sep 18, 2003 at 07:48 UTC

    Thank you andrey and lerik
    i have it up and running no root looger suits me for the time being.
    You were right it was a "inheritance" problem

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2015-12-01 10:33 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (798 votes), past polls