From: Mike S. <m...@pe...> - 2013-11-06 02:38:08
|
On Mon, 4 Nov 2013, 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. Apparently, not. This was fixed in Log4perl 1.35: https://github.com/mschilli/log4perl/commit/7d7fbbb45254d6c903f5b3cb91d7 > I see that Log::Log4perl is now version 1.42 on CPAN. I'm on Debian > Stable (Wheezy), which has version 1.29. I'd rather not upgrade via > 'cpan', as I've found that circumventing Apt and the Debian release > process leads to problems. I wouldn't do it in the main root to avoid stepping on the package manager's files, but if you maintain your own local directory via local::lib that should work just fine. Ideally, I wouldn't use the system perl for applications in the first place, but install a separate one via perlbrew et al. > I don't see liblog-log4perl-perl on Debian Backports. Later versions of Debian seem to have more up-to-date versions of Log4perl: http://packages.debian.org/sid/liblog-log4perl-perl -- -- Mike Mike Schilli m...@pe... > > Any suggestions? > > TIA, > > David > > > > 2013-11-04 23:08:03 dpchrist@p43200 ~/sandbox/perl > $ cat Log-Log4perl-logwarn.pl > #!/usr/bin/perl > use strict; > use warnings; > use Log::Log4perl qw(:easy); > warn "first warning"; > my $logger = Log::Log4perl->get_logger(); > $logger->logwarn("second warning"); > Log::Log4perl->easy_init($WARN); > warn "third warning"; > $logger->logwarn("fourth warning"); > > 2013-11-04 23:08:08 dpchrist@p43200 ~/sandbox/perl > $ perl Log-Log4perl-logwarn.pl > first warning at Log-Log4perl-logwarn.pl line 5. > third warning at Log-Log4perl-logwarn.pl line 9. > 2013/11/04 23:08:12 fourth warning > fourth warning at Log-Log4perl-logwarn.pl line 10 > > 2013-11-04 23:08:12 dpchrist@p43200 ~/sandbox/perl > $ cat Log-Log4perl-logdie.pl > #!/usr/bin/perl > use strict; > use warnings; > use Log::Log4perl qw(:easy); > my $logger = Log::Log4perl->get_logger(); > $logger->logdie("bye"); > > 2013-11-04 23:08:18 dpchrist@p43200 ~/sandbox/perl > $ perl Log-Log4perl-logdie.pl > bye at Log-Log4perl-logdie.pl line 6 > > 2013-11-04 23:08:23 dpchrist@p43200 ~/sandbox/perl > $ cat Log-Log4perl-logdie2.pl > #!/usr/bin/perl > use strict; > use warnings; > use Log::Log4perl qw(:easy); > Log::Log4perl->easy_init($WARN); > my $logger = Log::Log4perl->get_logger(); > $logger->logdie("bye"); > > 2013-11-04 23:08:31 dpchrist@p43200 ~/sandbox/perl > $ perl Log-Log4perl-logdie2.pl > 2013/11/04 23:08:34 bye > bye at Log-Log4perl-logdie2.pl line 7 > > 2013-11-04 23:08:34 dpchrist@p43200 ~/sandbox/perl > $ perl -MLog::Log4perl -e 'print $Log::Log4perl::VERSION, "\n"' > 1.29 > > 2013-11-04 23:08:45 dpchrist@p43200 ~/sandbox/perl > $ perl --version > > This is perl 5, version 14, subversion 2 (v5.14.2) built for > i486-linux-gnu-thread-multi-64int > (with 88 registered patches, see perl -V for more detail) > > Copyright 1987-2011, Larry Wall > > Perl may be copied only under the terms of either the Artistic License > or the > GNU General Public License, which may be found in the Perl 5 source kit. > > Complete documentation for Perl, including FAQ lists, should be found on > this system using "man perl" or "perldoc perl". If you have access to the > Internet, point your browser at http://www.perl.org/, the Perl Home Page. > > > 2013-11-04 23:08:55 dpchrist@p43200 ~/sandbox/perl > $ cat /etc/debian_version > 7.2 > > ------------------------------------------------------------------------------ > 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 > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > |