Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

error log file name

error log file name

error log file name


I hope this is an easy question.  I've been trying to find the log file where my Perl errors (STDERR) are going.  It is not being obvious.  I can redirect them to my own specific error log files, but I need to know where they were going originally, before I redirected them.  Is there a .dll file or something set in config.sys somewhere that will tell me where these were originally being written?

I have checked all the .log files on the server and found nothing that looks remotely like Perl error/informational messages.

Any help on this would be very much appreciated.

Thank you.


RE: error log file name

Kathy, are you running Perl CGI scripts, or just regular Perl scripts at the command line?

I think the default for non-cgi scripts is for STDERR to come right back to the screen - same as STDOUT.  But you can redirect STDERR when you invoke the script like this:

   $ my_script.pl 2>my_errors.log

For cgi-scripts, your webserver's config file probably has a spot for saying where the error log is, and I believe that's where STDERR messages go when written from a cgi script.  We use the Apache webserver, and in apache's httpd.conf, the directive ErrorLog gives the location of the error log, and that's where cgi STDERR messages go.


Hardy Merrill
Mission Critical Linux, Inc.

RE: error log file name

Note: STDERR will not be redirected with a
perl srcipt.pl > file.txt

call.  that only redirects STDOUT, so that any call to "die" or any time the script has compile/runtime errors, they'll go to the terminal.  if you wanna redirect STDERR, you have to do it in the script.
 well, this is only for non-cgi scripts.  for cgi's, i've never seen the logfile, and i think apache interprets them herself, throws them away, and gives her own rendition in apache/log/error.log .  to get at the errors my scripts are giving, i usually just run them on the command line.  i have a dummy file with the form pairs and other environmental variables the cgi would get from an imaginary  website, and do the following:
cat dummy.txt | perl script.pl > viewit.html

now that i think of it, though, you should be able to set the apache server to include the cgi errors.  maybe if you set the loglevel to Debug or Info?  i don't know.  i'll play with that.
hope i haven't been more confusing than helpful.

"If you think you're too small to make a difference, try spending a night in a closed tent with a mosquito."

RE: error log file name

Thank you HMerril and Stillflame.

The webserver I have is IIS, not Apache.  I have checked the normal webserver log files, and the errors don't go there.

I also have already re-directed the errors using:

use CGI::Carp qw(carpout);
open(AUTOLOG, ">>autoaccviolcgi.log") or
       die("Unable to open autoacviolcgi.log: $!\n");

This code gives me a date/time stamp and a program name for errors, which you don't always get with just the regular STDERR errors.  Redirecting the errors isn't a problem.

I am looking for config files that might indicate where Perl normally dumps its error messages.  The errors that I see in my newly redirected .log files were never going to the screen.  So, I need to know where they were going before I told them where to go.  I haven't re-directed the error log to specific files for all the Perl programs in the system, and I really don't want to do that.  I'd rather look at the log that Perl just normally uses instead of changing all the programs to use special log files.

These errors are usually 'informational' errors, not program-killing errors.  I'm using the -w on the first line of code in my programs.  So I get some 'extra' errors that should be cleaned up, but aren't normally life-threatening.

If it makes any difference, the server operating system is NT.

Thank you.


RE: error log file name

I'm not going to be much help with NT - but normally on *nix, for scripts(including both shell and Perl scripts) run at the command line, both STDERR and STDOUT go back to the screen.  I believe Perl just follows the STDOUT and STDERR that are already defined on your system - where they're defined I don't know, but I *don't* think Perl has it's own STDERR and STDOUT.  Again, cgi STDERR is probably defined in the webserver configuration file.

Hardy Merrill
Mission Critical Linux, Inc.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close