[log4perl-devel] log4perl question

2008-02-06 Thread Fernando Sousa
Hi all,

probably you can give some help on this topic.
I'm using the Log-Log4perl-1.14 and I've initialize the following log.conffile:

[root@ test]# cat log.conf

# A simple root logger with a Log::Log4perl::Appender::File
# file appender in Perl.


log4perl.rootLogger=ERROR, LOGFILE

log4perl.appender.LOGFILE=Log::Log4perl::Appender::File
log4perl.appender.LOGFILE.filename=/tmp/myerrs.log
log4perl.appender.LOGFILE.mode=append

log4perl.appender.LOGFILE.layout=PatternLayout
log4perl.appender.LOGFILE.layout.ConversionPattern=%d %p> %F{1}:%L %M - %m%n


With this setup, log4perl will catch all Errros and stores it at
/tmp/myerrs.log file.
My intention is to capture ERRORs and also the INFOs traces.
Something like "log4perl.rootLogger=ERROR and INFO, LOGFILE".

Is it possible to do ?? if yes, how it does??


Best Regards,
Fernando
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
log4perl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/log4perl-devel


Re: [log4perl-devel] l4p & mod_perl startup handler

2008-02-06 Thread Kevin M. Goess
The simple way to do a startup-handler is to put something like this in
your apache config:

PerlRequire /path/to/handler.pl

You can init log4perl in there.  That gets run when apache starts up,
and so that initialization will affect the perl interpreter thereafter.

The fancy way to do a handler is described here:

http://perl.apache.org/docs/1.0/guide/getwet.html#A_Simple_Apache_Perl_Content_Handler

One or the other may be more or less appropriate depending on the rest
of the environment you're in, for instance:

http://www.masonhq.com/docs/manual/Admin.html#writing_a_wrapper


Berg, Eric wrote:
> I'm setting up apache 1.3 to serve up an app that uses my modules that
> make extensive use of Log4perl, but I'm not sure how to initialize it.
> I've read 
> 
> http://log4perl.sourceforge.net/releases/Log-Log4perl/docs/html/Log/Log4
> perl.html#a36c1
> Log::Log4perl - Log4j implementation for Perl
> 
> and 
> http://log4perl.sourceforge.net/releases/Log-Log4perl/docs/html/Log/Log4
> perl/FAQ.html#792b4
> Log::Log4perl::FAQ - Frequently Asked Questions on Log::Log4perl
> 
> but have had no luck finding out exactly what a "startup handler" is.
> 
> Does anybody have any example code, including apache config, for
> initializing l4p in a mod_perl context?
> 
> Thanks
> 
> Eric D. Berg
> Lehman Brothers
>> Fixed Income Research
>> 745 7th Avenue, 15th floor
>> New York, NY 10019
>> Phone +1 212 526 8118
>>
>>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
> - - - - -
> 
> This message is intended only for the personal and confidential use of the 
> designated recipient(s) named above.  If you are not the intended recipient 
> of this message you are hereby notified that any review, dissemination, 
> distribution or copying of this message is strictly prohibited.  This 
> communication is for information purposes only and should not be regarded as 
> an offer to sell or as a solicitation of an offer to buy any financial 
> product, an official confirmation of any transaction, or as an official 
> statement of Lehman Brothers.  Email transmission cannot be guaranteed to be 
> secure or error-free.  Therefore, we do not represent that this information 
> is complete or accurate and it should not be relied upon as such.  All 
> information is subject to change without notice.
> 
> 
> IRS Circular 230 Disclosure:
> Please be advised that any discussion of U.S. tax matters contained within 
> this communication (including any attachments) is not intended or written to 
> be used and cannot be used for the purpose of (i) avoiding U.S. tax related 
> penalties or (ii) promoting, marketing or recommending to another party any 
> transaction or matter addressed herein.
> 
> 
> 
> -
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
> ___
> log4perl-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/log4perl-devel


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
log4perl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/log4perl-devel


Re: [log4perl-devel] log4perl question

2008-02-06 Thread Kevin M. Goess
Fernando, if I understand your question correctly, this line that you have:

log4perl.rootLogger=ERROR, LOGFILE

tells log4perl to send all messages whose log level is "error" or
"fatal" to your LOGFILE appender.  If you want to send "info" messages
too, then do this, changing ERROR to INFO:

log4perl.rootLogger=INFO, LOGFILE

That will send all messages of level "info", "warn", "error" and "fatal"
to your LOGFILE.

Does that answer your question?

Fernando Sousa wrote:
> Hi all,
> 
> probably you can give some help on this topic.
> I'm using the Log-Log4perl-1.14 and I've initialize the following
> log.conf file:
> 
> [root@ test]# cat log.conf
> ##
> ##
> # A simple root logger with a Log::Log4perl::Appender::File
> # file appender in Perl.
> 
> 
> log4perl.rootLogger=ERROR, LOGFILE
> 
> log4perl.appender.LOGFILE=Log::Log4perl::Appender::File
> log4perl.appender.LOGFILE.filename=/tmp/myerrs.log
> log4perl.appender.LOGFILE.mode=append
> 
> log4perl.appender.LOGFILE.layout=PatternLayout
> log4perl.appender.LOGFILE.layout.ConversionPattern=%d %p> %F{1}:%L %M - %m%n
> 
> 
> With this setup, log4perl will catch all Errros and stores it at
> /tmp/myerrs.log file.
> My intention is to capture ERRORs and also the INFOs traces.
> Something like "log4perl.rootLogger=ERROR and INFO, LOGFILE".
> 
> Is it possible to do ?? if yes, how it does??
> 
> 
> Best Regards,
> Fernando
> 
> 
> 
> 
> -
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
> 
> 
> 
> 
> ___
> log4perl-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/log4perl-devel


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
log4perl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/log4perl-devel