It appears that your browser does not support JavaScript, or you have it disabled. This site is best viewed with JavaScript enabled.
 
Products
In addition to a broad range of customized services, we have a number of quality offerings for businesses large and small: TrollDrum»   FreqLoader»   Contest management »   Voice messaging »   Shipping »   XML parsing »   VoiceXML browser »   Mail hosting »   RPM creation » Error Log browser » PHP Shell access »
The Frontal lobes
The frontal Lobes - and the Psychogenic team - are involved in planning, organizing and problem solving.
More »
 :: Feedback :: 

Did a great job, spent extra time working on it to make sure everything was workigt right....very pleased

David
Nextedge
Website »

All Feedbacks
:: Featured Project ::
Click HERE for more

Errorlog.cgi - Apache Error Log Formatter

To err may be human but picking through the Apache webserver error logs just isn't very fun. Because we spend lots of time debugging web applications, CGIs and other Apache-related goodies, we've developed a small script which transforms messy log files like this:

Standard error_log file

into easy to read pages viewable through a browser, like this:

Beautified error_log file

The program will let you view any of a number of error_log files, merging multiline entries while preserving formatting (which is especially useful when you have a tendency to dump complex data structures to standard error when faced with a debugging challenge, like I often do).

The CGI requires only a webserver (on a Un*x box, though it should be runnable elsewhere) and a standard Perl install with the CGI.pm module (which I believe is part of the default installation). To use it, :

  1. Download errorlog-1.4.tar.bz2 (get errorlog-1.4.tar.gz if you are using a crippled decompression program that doesn't understand bz2 files, such as on certain OSes that shall remain nameless).
  2. Unpack it, using tar jxvf errorlog-1.4.tar.bz2
  3. Edit a few of the CGI configuration variables if necessary (see USAGE below) and
  4. Plunk the script into your cgi-bin/.

Full instructions are included below and in the included pod documentation (do a "perldoc /path/to/installed/errorlog.cgi").

A final word for developers with non-Unix workstations. It seems IE and/or WinZip have trouble with the tar.bz2 files, so get the tar.gz package instead. Also, if you are working on a remote system to which you only have limited access (e.g. FTP-only) and don't know where the apache error logs are located:

  • If you can run CGIs, upload the following code:
    	#!/usr/bin/perl 
    	print "Content-type: text/plain\r\n\r\n"; 
    	print join('', `locate error_log`); 
    	exit(0);
    
    make it executable and view the output through a browser. If they have installed the locate utility you should see the log file(s) available (though this may not work because of other permission issues).
  • If locate doesn't work, good possible guesses:
    • /usr/local/apache2/logs/error_log
    • /usr/local/apache/logs/error_log
    • /var/log/httpd/error_log
  • Otherwise, you'll need to ask support where error log output is stored

Errorlog.cgi perldoc


errorlog.cgi - log formater

NAME

        errorlog.cgi - Apache error log formater/browser

SYNOPSIS

errorlog.cgi allows web developers quick and easy access to clearly formatted entries from the apache error log file, viewable through a standard browser. It is designed with the developer in mind, with a focus on debugging CGI error logs.

DESCRIPTION

This program will read any number of entries from one or more standard Apache error_log files and provide a formatted HTML display of the result. Its main purpose is to de-mangle and clarify the data the winds up in the error_log while developing dynamic websites.

It merges multiline entries, adds some highlighting for common elements (such as file paths, quoted strings, timestamps and digits) and transforms referer strings into hyperlinks.

One important feature for the developer is that dumps of complex data (such as object dumps using the perl Data::Dumper module) which span multiple line are merged and their whitespace formatting is preserved.

See the program page at http://www.psychogenic.com/en/products/Errorlog.php for details and comparison screenshots.

REQUIREMENTS

A Unix webserver, one or more Apache (http://httpd.apache.org) webserver error log in standard format. Perl and the CGI.pm module.

USAGE

To use the program, edit the source and verify/set:

 - the bang path (e.g. "#!/usr/bin/perl") at the top of the script to point to your 
 perl executable
 
 - the $ThisCGI variable to the full (web) path to this cgi, (e.g. '/cgi-bin/errorlog.cgi')
 
 - the $TailCmd variable to the full path of the 'tail' command on your system 
   (e.g. '/usb/bin/tail')
 
 - the %ErrorLogs hash.  You may use the program to select from a number of error logs, 
   for instance in cases where you've set the ErrorLog directive to point to virtual 
   host-specific files.  Add entries of the form:
   
   'uniquename' => '/path/to/an/error_log',
   
   to the hash.  Having multiple error logs, you can select the relevant log through 
   the menu displayed.

You may choose to edit the display color scheme by editing the %SystemColors hash accordingly.

Once the system is configured, install the errorlog.cgi at some location where the webserver will be able to access and execute the program. If you are using the cgi-bin ScriptAlias, this directory is a good spot to make the program accessible to all virtual domains at http://virtdomain.example.com/cgi-bin/errorlog.cgi

Make sure the program is executable by doing a `chmod a+x /path/to/installed/errorlog.cgi`

Finally, access the script through your browser and use da menu.

AUTHOR INFORMATION

Copyright (C) 2004 Pat Deegan, Psychogenic.com. All Rights Reserved.

You may reach us through the contact info at http://www.psychogenic.com

LICENSE

Copyright (C) 2004 Pat Deegan, Psychogenic.com. All Rights Reserved.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

NOTES

This program is a hack. It is inefficient and actually contains hardcoded text strings and HTML! But it is a nice hack that has served us well on numerous projects, and so we offer it to you. Suggestions are welcome but code would be better ;) .

« Go back

 :: About :: 

The frontal lobes
The frontal lobes are considered our emotional control center and home to our personality. [They] are involved in motor function, problem solving, spontaneity, memory, language, initiation, judgement, impulse control, and social and sexual behavior. [+]

Pssst...
Do not hesitate to contact us if you wish to get a quote on an installation or customization of any of our products :-D
Site under construction...
Version franĉaise English Version
Copyright © 2000-2003 Psychogenic inc. All Rights Reserved.