in reply to Re: Log4Perl issue
in thread Log4Perl issue

The issue is sometimes I am able to see module 'a' log in the a.log file.
But in case module 'b'is running then module a's log is written in b.log


log4perl.logger.a = DEBUG, a
log4perl.b=DEBUG, b
log4perl.appender.a = Log::Log4perl::Appender::File
log4perl.appender.a.filename = a.log
log4perl.appender.a.max = 15
log4perl.appender.a.DatePattern = yyyy-MM-dd
log4perl.appender.a.mode = append
log4perl.appender.a.TZ = BST
log4perl.appender.a.layout = Log::Log4perl::Layout::PatternLayout
log4perl.appender.a.layout.ConversionPattern = %d %c - %m%n

log4perl.appender.b=Log::Dispatch::File
log4perl.appender.b.filename=b.log
log4perl.appender.b.mode=append
log4perl.appender.b.layout=Log::Log4perl::Layout::PatternLayout
log4perl.appender.b.layout.ConversionPattern = %d %c - %m%n


package a;
BEGIN {
Log::Log4perl::init_and_watch('/etc/log4perl.conf',30);
$__PACKAGE__::mylog=Log::Log4perl->get_logger();
}


the module b is defined inside b.pl script
BEGIN {
package b;
Log::Log4perl::init_and_watch('log4perl.conf',30);
$__PACKAGE__::mylog=Log::Log4perl->get_logger(__PACKAGE__);
}



Replies are listed 'Best First'.
Re^3: Log4Perl issue
by Anonymous Monk on Jan 03, 2007 at 18:50 UTC
    What is log4perl.b=DEBUG, b?
      Sorry!!
      It's typo its log4perl.logger.b = DEBUG, b

      But anyway in the code its fine.