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__} = sub {
local $Log::Log4perl::caller_depth =
$Log::Log4perl::caller_depth + 1;
WARN @_;
};
$SIG{__DIE__} = sub {
$Log::Log4perl::caller_depth++;
my ($temp) = @_;
$temp =~ 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
Peter Gibbons
UBS Investment Bank, Equities IT
9 Appold Street, London, EC2A 2HL
Tel: 0207 568 7970 Internal: (1931) 87970
-----Original Message-----
From: Mike Schilli [mailto:m@xxxxxxxxxxxxxxx]
Sent: 15 October 2004 18:47
To: Gibbons, Peter
Cc: log4perl-devel@xxxxxxxxxxxxxxxxxxxxx
Subject: Re: [log4perl-devel] die and fatal
On Fri, 15 Oct 2004 Peter.Gibbons@xxxxxxx 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@xxxxxxxxxxxxxxx
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.
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
|
Try Searching:
servers, voip, java, networking, microsoft ...
|
|
|
|