Ok so if I understand correctly some best practices in my case are

- Modules do not call init. Ever!
- :easy mode really means :lazy mode thus you SHOULD use it
- Script that calls any module that uses log4perl or calls a module that
calls another module that uses log4perl should do the init call
- Use one configuration file for all modules using log4perl and split
them via categories

Curious why is log4perl constrained like that? Is it something to do
with constants? Was there a technical trade off?

Thanks,
------------------------------------------
Ali Mesdaq
Security Researcher II
Websense Security Labs
http://www.WebsenseSecurityLabs.com
------------------------------------------

-----Original Message-----
From: Mike Schilli [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 18, 2007 9:37 PM
To: Mesdaq, Ali
Cc: log4perl-devel@lists.sourceforge.net
Subject: Re: [log4perl-devel] Initializing Question

On Wed, 18 Jul 2007, Mesdaq, Ali wrote:

> But something I am still confused about is the initialize once and 
> only once that is discussed in the docs. If I have several modules 
> that use each other and they all use log4perl how does that impact me?
> Is the initialize once and only once referring to per module or object

> or per process or per system? If its any of the latter two then 
> wouldn't you always want to use init_once?

Only the main program should call init(). Modules should not use init().

init_once() is useful only in scenarios where your code runs by the same
init() call more than once and you want to run init() only the first
time (e.g. with CGI scripts running under Apache::Registry).

 -- Mike

Mike Schilli
[EMAIL PROTECTED]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
log4perl-devel mailing list
log4perl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/log4perl-devel

Reply via email to