我试图设置两个附加程序,但它似乎只写入 STDERR:
my $header = "######$scriptname $version";
use Log::Log4perl qw(:easy);
Log::Log4perl->easy_init($DEBUG);
my $logger = get_logger();
my $layout = Log::Log4perl::Layout::PatternLayout->new(
"%d %p> %F{1}:%L %M - %m%n");
my $appender = Log::Log4perl::Appender->new(
"Log::Dispatch::File",
filename=>$scriptname.".log",
mode => "append"
);
$appender->layout($layout);
my $stderr = Log::Log4perl::Appender::Screen->new(
stderr =>0,
);
$stderr->layout($layout);
$logger->info($header);