On 11/04/2013 11:18 PM, David Christensen wrote: > I was expecting logwarn() would always output the > warning message to the terminal, and additionally output the warning > message to the log destination if logging is enabled.
I found a work-around -- write a wrapper that calls warn() and $logger->warn() instead. HTH, David 2013-11-05 10:01:04 dpchrist@p43200 ~/sandbox/perl $ cat Log-Log4perl-warn.pl #!/usr/bin/perl use strict; use warnings; use Log::Log4perl qw(:easy); sub mylogwarn { my $logger = Log::Log4perl->get_logger(); warn @_; $logger->warn(@_); } mylogwarn "first warning"; Log::Log4perl->easy_init($WARN); mylogwarn "second warning"; 2013-11-05 10:01:10 dpchrist@p43200 ~/sandbox/perl $ perl Log-Log4perl-warn.pl first warning at Log-Log4perl-warn.pl line 7. second warning at Log-Log4perl-warn.pl line 7. 2013/11/05 10:01:13 second warning ------------------------------------------------------------------------------ November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming models. Explore techniques for threading, error checking, porting, and tuning. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk _______________________________________________ log4perl-devel mailing list log4perl-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/log4perl-devel