Re: [log4perl-devel] log4perl causing perl process to die (fwd)

2007-11-06 Thread Kevin M. Goess
Mike Schilli wrote:
> I see -- the recommended ways of synchronizing access to an appender are
> listed in the Log4perl FAQ:
> 
> http://log4perl.sourceforge.net/d/Log/Log4perl/FAQ.html#23804

Something I learned recently that's apropos that I've been meaning to
mention: on Linux, you don't have to worry about interleaving messages
when writing to the same file as long as the messages themselves are
smaller than PIPE_BUF, which on my FC5 machine here is defined as 4096
bytes:

$ grep -r PIPE_BUF /usr/include/
/usr/include/linux/limits.h:#define PIPE_BUF 4096
/* # bytes in atomic write to a pipe */



-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
log4perl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/log4perl-devel


Re: [log4perl-devel] appender/dispatcher that writes to per-category files

2007-11-06 Thread Jonathan Swartz
> On Mon, 5 Nov 2007, Jonathan Swartz wrote:
>
>> Right, I expected that new categories would keep cropping up. Why
>> would it be a problem for an appender to open new filehandles on the
>> fly? Other than worrying about maximum # of filehandles?
>
> Categories are added at init() time, not at log() time. If you add  
> a new
> category to Log4perl, you have to run init().

Huh? I can add a category at runtime like

 my $log = Log::Log4perl->get_logger('foo.bar.baz');

without having declared foo.bar.baz at init() time.

I think you mean that categories are associated with appenders at init 
() time, right? But I'm not looking to create a ton of different  
appenders. I'm looking to create a single appender that handles all  
categories, and automatically writes to the right filename based on  
the category passed to log().

Jon



-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
log4perl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/log4perl-devel