From: <Pet...@ub...> - 2004-10-18 09:25:58
|
Hi Mike, i have a further problem that will complicate the matter:( I have thousands of die and warn statements that i dont intend to = change, so hence the use of logdie and logwarn with the following signal = trap: $SIG{__WARN__} =3D sub { local $Log::Log4perl::caller_depth =3D $Log::Log4perl::caller_depth + 1; WARN @_; }; $SIG{__DIE__} =3D sub { $Log::Log4perl::caller_depth++; my ($temp) =3D @_; $temp =3D~ s/\n//ig; LOGDIE $temp; }; given this limitation how can i only log the formatted log4perl messages = and ignore duplicated warn/die messages? any thoughs=20 Peter Gibbons=20 UBS Investment Bank, Equities IT 9 Appold Street, London, EC2A 2HL Tel: 0207 568 7970 Internal: (1931) 87970 =20 -----Original Message----- From: Mike Schilli [mailto:m...@pe...] Sent: 15 October 2004 18:47 To: Gibbons, Peter Cc: log...@li... Subject: Re: [log4perl-devel] die and fatal On Fri, 15 Oct 2004 Pet...@ub... wrote: > I would like to remove the final entry of 'arrrrhhhhhhhh' from my = output, it was produced with a $logger->logdie("arrrrhhhhhhhh") or if i = use a $logger->logwarn("arrrrhhhhhhhh"); > > bash-2.05b$ perl eqtas_scheduler.pl > [2004/10/15 17:24:44] [INFO] [MESSAGE:Commencing Command Line Batch = run, details to follow..] [SENDER:scheduler.pl] [LINE:62] > [2004/10/15 17:24:44] [FATAL] [MESSAGE:arrrrhhhhhhhh] = [SENDER:scheduler.pl] [LINE:63] > > arrrrhhhhhhhh at scheduler.pl line 63 Instead of $logger->logdie("xxx"), if you call $logger->fatal("xxx"); exit 0; then you just get the message logged, no message from die() on STDERR. = Maybe we should add $logger->logexit("xxx"); to Log::Log4perl which logs a FATAL message and then just exits? -- Mike Mike Schilli m...@pe... Visit our website at http://www.ubs.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments. |