in reply to Capturing Error message in a log file.
Second, if you have access to a bash or bourne shell, you could just redirect STDERR to a file at the command line, like this:
(There is a Windows port of bash, if you happen to be on a Windows system.)your_script [options and args] 2> errlog
Finally, if neither of the above points will work for you, try this at the beginning of your script:
That way, you don't need any special functions or special DBI connect args -- everything that Perl would normally print to STDERR will be stored in the file whose name is provided in "$debug_output". (The original STDERR handle will be closed, so no error messages will go to the console.)open( STDERR, ">>$debug_output" ) or die "Can't write errlog: $!\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Capturing Error message in a log file.
by pfaut (Priest) on Jan 03, 2003 at 13:25 UTC |