|
From: Mike S. <m...@pe...> - 2009-05-30 04:03:20
|
On Fri, 29 May 2009, Jean-Denis Muys wrote:
> I am a relative newbie and I hope I ask in the right place.
Sure.
> A similar idiom seems to work also for Log4Perl config file:
> use FindBin;
> Log::Log4perl::init("$FindBin::Bin/KConfig.conf");
> Is this the correct and idiomatic way to solve my issue?
If you can't rely on an absolute path, that's a good way to find it.
> The only other way I can see is to change at start time the Cwd to be
> $FindBin::Bin (or some equivalent parsed from $0).
I wouldn't use a relative path for the Log4perl configuration, you might
hit problems down the road if the program chdir()s somewhere else and a
reload via init_and_watch() or similar is required. Using the absolute
path like you did above is better.
> The FAQ solution did not work, because I had an additional line at the top
> of my .conf file reading:
> log4perl.threshold = INFO
> And then my FATAL log file was also clobbered by all messages of level INFO
> or higher.
Ah, good find, that's a bug. The system-wide threshold is not supposed
to lower appender thresholds. Here's the fix:
http://github.com/mschilli/log4perl/commit/a98bbfb82025098779b8cb73eec4870a06ffdec7
I'll go out in the next (1.24) release.
Thanks for reporting this.
-- Mike
Mike Schilli
m...@pe...
|