Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
No such thing as a small change
 
PerlMonks  

Re: log4perl question

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

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to log4perl question

Howdy,

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!

-Eric

--
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."

Replies are listed 'Best First'.
Re: Re: log4perl question
by leriksen (Curate) on Sep 17, 2003 at 20: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 03: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
    thanks

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://292119]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.