Hi Micheal,
Thanks for the quick reply!
Below is the script which reproduces the scenario:
use strict;
use Log::Log4perl qw(:easy);
my $conf = <<EOT;
log4perl.logger.some.module = INFO, someAp
log4perl.additivity.some.module = 0
log4perl.appender.someAp = Log::Log4perl::Appender::Screen
log4perl.appender.someAp.layout = Log::Log4perl::Layout::SimpleLayout
EOT
my $conf2 = <<EOT;
log4perl.rootLogger = INFO, someAp2
log4perl.appender.someAp2 = Log::Log4perl::Appender::Screen
log4perl.appender.someAp2.layout = Log::Log4perl::Layout::SimpleLayout
EOT
Log::Log4perl->init(\$conf);
my $logger = get_logger( "some::module" );
$logger->info( "Hooray!" );
print "Additivity: ", $logger->additivity(), "\n";
Log::Log4perl->init(\$conf2);
print "Additivity: ", $logger->additivity(), "\n";
some::module->test();
#any log lines from some.module wont be logged.
#comment out line 24 and you will see the log line from some::module::test
package some::module;
use Log::Log4perl qw(:easy);
sub test {
$logger->info( "This wont be logged" );
}
Thanks,
On Wed, Oct 8, 2014 at 2:47 AM, Michael_Schilli via RT <
bug-Log-Log4perl@rt.cpan.org> wrote:
Show quoted text> <URL:
https://rt.cpan.org/Ticket/Display.html?id=99361 >
>
> On Tue Oct 07 16:47:14 2014, gurub_n@yahoo.co.in wrote:
> > Sample scenario: say my config has this line
> > log4perl.logger.some.module = INFO, someAp
> > log4perl.additivity.some.module = 0
>
> I've tried to reproduce the problem you've reported, but found that it
> works as expected:
>
> use strict;
>
> use Log::Log4perl qw(:easy);
>
> my $conf = <<EOT;
> log4perl.logger.some.module = INFO, someAp
> log4perl.additivity.some.module = 0
> log4perl.appender.someAp = Log::Log4perl::Appender::Screen
> log4perl.appender.someAp.layout = Log::Log4perl::Layout::SimpleLayout
> EOT
>
> Log::Log4perl->init(\$conf);
>
> my $logger = get_logger( "some::module" );
> $logger->info( "Hooray!" );
> print "Additivity: ", $logger->additivity(), "\n";
>
> $logger->additivity(1);
> print "Additivity: ", $logger->additivity(), "\n";
>
> Log::Log4perl->init(\$conf);
> print "Additivity: ", $logger->additivity(), "\n";
>
> Can you post code that reproduces the problem?
>