How can log4perl write to STDERR and a file at the same time?
问题 I tried to set up two appenders, but it seems to only write to 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