On Tue, 26 Sep 2006, Martin J. Evans wrote:
> After loads of searching around and debugging I realised I'd missed
> the obvious which is I am using two sorts of appenders -
> Log::Dispatch::File and Log::Log4perl::Appender::File. The latter
> seems to support the utf8 flag, the former does not. I have no idea
> why I've mixed File appenders from different places. Other than the
> obvious difference of one supports utf8 and the other does not is
> there any reason any one knows why I shouldn't just swap my
> Log::Dispatch::File appenders to Log4perl ones?
I'd recommend using Log::Log4perl::Appender::File instead of
Log::Dispatch::File throughout your project. The former has a lot of
options (utf8, re-creating missing files, switching files,
permissions, umasks ...) that the latter doesn't.
> As an aside, why the duplication of File appenders with different
> functionality? This cost me some time to locate.
Log::Log4perl::Appender::File is part of the Log4perl project,
Log::Dispatch::File is not. It's 3rd party.
Log4perl supports appenders in the Log::Dispatch::* hierarchy to
avoid duplication of effort, which backfires in this case :).
As a rule of thumb, if there's a Log4perl appender and a 3rd party
appender that are doing the same thing, use the Log4perl one --
chances are they've been created because the 3rd party appender
wouldn't provide the functionality needed.
-- Mike
Mike Schilli
m...@pe...
>
> Thanks.
>
> Martin
> --
> Martin J. Evans
> Easysoft Ltd, UK
> http://www.easysoft.com
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> log4perl-devel mailing list
> log...@li...
> https://lists.sourceforge.net/lists/listinfo/log4perl-devel
>
|