Jeff Pang wrote:
using a logging facility (either RYO or a syslog interface) to log,
using that interface to write both the data and the errors I'm
interested in (which may be differnt from what Perl sees fit to write
to STDERR) to the appropriate files, and redirecting STDERR to
/dev/null so it
Jay Savage wrote:
As for simply redirecting STDERR, most people don't really want to do
this with a daemon. If you're using strictures and warnings, you
expect many daemons to produce hundres, possibly thousands, of lines
of warnings, depending on the purpose of the daemon, how busy it is,
and ho
>using a logging facility (either RYO or a syslog interface) to log,
>using that interface to write both the data and the errors I'm
>interested in (which may be differnt from what Perl sees fit to write
>to STDERR) to the appropriate files, and redirecting STDERR to
>/dev/null so it doesn't clutte
On 3/21/06, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote:
> Jeff Pang wrote:
> >> So why wouldn't you redirect STDOUT and STDERR to this file too? Many
> >> other Perl's errors, like division by zero, are not handle via die or
> >> warn. And these messages are printed out even if encountered in an
Jeff Pang wrote:
So why wouldn't you redirect STDOUT and STDERR to this file too? Many
other Perl's errors, like division by zero, are not handle via die or
warn. And these messages are printed out even if encountered in an eval.
When operating the files (including opening and writing and cl
>
>So why wouldn't you redirect STDOUT and STDERR to this file too? Many
>other Perl's errors, like division by zero, are not handle via die or
>warn. And these messages are printed out even if encountered in an eval.
>
When operating the files (including opening and writing and closing),you ha
Jeff Pang wrote:
I turned off the STDOUT/STDERR in my program in order to avoid the
> possible mussy error-infos appearing on screen.While I wouldn't
> lose the valuable infos,since I re-defined both signal 'die'
> and 'warn' handler and wrote the results to files.
--
Jeff Pang
NetEase AntiSp
>But why would you do that? If
>something went wrong, you could not determine what.
>
I turned off the STDOUT/STDERR in my program in order to avoid the possible
mussy error-infos appearing on screen.While I wouldn't lose the valuable
infos,since I re-defined both signal 'die' and 'warn' handle
Jeff Pang wrote:
* If it's started in a terminal, the output will appear in that
terminal, even if started in background and with nohup(1).
* If it's started by cron(1), the output is gathered and e-mail to you
when the program terminates.
* If it's started by init(1), the output is send to
>
>* If it's started in a terminal, the output will appear in that
>terminal, even if started in background and with nohup(1).
>
>* If it's started by cron(1), the output is gathered and e-mail to you
>when the program terminates.
>
>* If it's started by init(1), the output is send to the consol
Jeff Pang wrote:
open (HDW,">>",$err_log)
or die "Can't open log file $err_log: $!\nError: "[EMAIL PROTECTED];
print HDW $time," ",@_
or die "Can't write to log file $err_log: $!\n Error: "[EMAIL
PROTECTED];
Thanks,Jay,you are more exactly.
I don't use the
>open (HDW,">>",$err_log)
>or die "Can't open log file $err_log: $!\nError: "[EMAIL
> PROTECTED];
>print HDW $time," ",@_
>or die "Can't write to log file $err_log: $!\n Error: "[EMAIL
> PROTECTED];
Thanks,Jay,you are more exactly.
I don't use the 'or di
Jay Savage wrote:
Actually, you probably want that to be:
$SIG{__DIE__}=\&log_die;
sub log_die
{
my $time=scalar localtime;
open (HDW,">>",$err_log)
or die "Can't open log file $err_log: $!\nError: "[EMAIL PROTECTED];
print HDW $time," ",@_
On 3/19/06, Jeff Pang <[EMAIL PROTECTED]> wrote:
>
> >How do I log die errors and exit nicely.
>
>
> Hi,you could re-defined signal die handler,for example:
>
> $SIG{__DIE__}=\&log_die;
> sub log_die
> {
> my $time=scalar localtime;
> open (HDW,">>",$err_log);
> print HDW $time," ",@_;
>How do I log die errors and exit nicely.
Hi,you could re-defined signal die handler,for example:
$SIG{__DIE__}=\&log_die;
sub log_die
{
my $time=scalar localtime;
open (HDW,">>",$err_log);
print HDW $time," ",@_;
close HDW;
die @_;
}
when your program call the 'die',it s
15 matches
Mail list logo