[cgiapp] Graceful Error Handling in CGI::App (compile / init stages)

Jerry Kaidor jerry at tr2.com
Wed Jul 7 17:20:54 EDT 2010


> On 07/07/2010 05:16 AM, Mike Tonks wrote:

>
> It's verbose, but the only thing I know of is:

>
> Btw, it's not a good idea to show detailed error messages on your
> website.
*** Concur.   I get a lot of mileage out of Sys::Syslog.   It's easy to
get your logging done to a separate file just for your webapp.  Just
choose a facility that nobody else is using ( I use "local0" ) and put a
line in /etc/syslog.conf for it.

   When things get totally hosed and I can't figure out what's going
on, I even resort to one-letter syslogs in strategic places - "OK, it got
here".

  if( $bumbersnoot )
      {
      syslog( 'debug', "A" );
      # do the usual useful bumbersnoot stuff...
      }
   else
      {
      syslog( 'debug', "B" );
      # Don't need no steenkin bumbersnoot!
      }

   I generally have a couple of terminals running: + one tailing -f the
server error file, and the other one looking at my webapp log file.

                       - Jerry Kaidor






More information about the cgiapp mailing list