Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Accessing Log::Log4perl Configuration Values

by valdez (Monsignor)
on Mar 19, 2007 at 11:41 UTC ( #605457=note: print w/ replies, xml ) Need Help??


in reply to Re: Accessing Log::Log4perl Configuration Values
in thread Accessing Log::Log4perl Configuration Values

Ciao whereiskurt,

I know how to use Log4perl configuration files :)) The problem was different, let me rephrase it: I want to access l4p configuration values from outside l4p itself, how? An home-made parser is not the solution, as I should implement also variable substitution; on the other side, l4p Config classes are not so friendly. Now, I'm asking myself if the way I used the Log4perl classes is correct or not.

Thanks, Valerio


Comment on Re^2: Accessing Log::Log4perl Configuration Values
Re^3: Accessing Log::Log4perl Configuration Values
by whereiskurt (Friar) on Mar 19, 2007 at 15:45 UTC

    Valerio, after looking at your home node it's pretty clear that you would know how to use log4perl :) <kneels humbly>

    I wonder how you moved forward on this problem? It would seem there are only two ways to go: either you're building a config on the fly and using the log4perl::init call, or you're letting log4perl parse through a config already made and working with the log4perl->value madness. :)

    I wonder <outloud apparently> if slupring the 'l4p.conf' and munging it might really be your best option? I suspect that the variable substitution wouldn't be that tricky afterall... regards!

    Kurt

    PS: I realise that you said *do not* want yet another home made parser but here's one just incase anyone was interested (or incase you changed your mind :))

      Scenario: I have the same program running with different configurations; every instance of that program uses a different log4perl configuration file; what I need is a way to know where an instance logs.

      I really don't want to reinvent a l4p configuration parser: there is already one working :) In fact, what I wrote to parse a conf uses classes provided by Log4perl, but in a way probably not intended by the author, who did not release any documentation about this possible use of Log::Log4Perl::Config class and subclasses.

      Anyway, thanks again for your kind answers!

      Ciao, Valerio

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (12)
As of 2014-12-19 13:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (82 votes), past polls