bpurcell.org - Capturing and emailing errors
Calendar
SunMonTueWedThuFriSat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Subject Archives
Amazon EC2 (15)
ColdFusionMX (155)
Corvette (3)
Flash Lite (4)
Flash Media Server (5)
Flash Player (3)
Flex (39)
General Web Dev (14)
HDTV (3)
Jboss (1)
Jquery (2)
JRun (59)
Max 2003 (3)
Other (33)
PC Hardware (16)
Software (17)
SpatialKey (7)
Wireless (8)
Working Out (1)

RSS Feed
Feed Listing

Site Contents
Home
My Blog
ColdFusion
JRun
Flex
Wireless & Networking
Hardware & Gadgets
HDTV
Software Picks
Pictures
Contact Me
Search


My Articles & Papers
Flex Performance
Server/Client
mm.com Under the Hood
Multiple Instances of CFMX
Multiple Instance Config
NLB with ColdFusion
Clustering CFMX for J2EE
Multi-Tier Hardware LB w CFMX
Cisco CSS & Coldfusion MX
JRun 4 Jini based Clustering
WiFi Growth

2ID Tacweb

Other Hobbys
Body-For-Life Challenge

Personal Projects
Family Pool
Deck Gate

username:
password:
 

 
Viewing Individual Entry / Main
September 26, 2006

Most developers do not spend a lot of time reviewing logs so a lot of errors occur without ever knowing about them. If every error ends up in your inbox then you are forced to address them. I use a template similar to the one below for every site I have developed.

<!--- Send an email with information about the error --->
<CFMAIL TO="youremail@host.com" FROM="error@site.com" 
 SUBJECT="Error on http://#CGI.HTTP_HOST##CGI.SCRIPT_NAME#" TYPE="HTML">
A user experienced an error on #ERROR.template#. 
<P>The error information is as follows:<BR>
Diagnostics: #ERROR.Diagnostics#<BR>
Template: #ERROR.template#<BR>
Query String: #ERROR.QueryString#<BR>
Path Info: #CGI.PATH_INFO#<BR>
Referer: #CGI.HTTP_REFERER#<BR>
IP: #CGI.REMOTE_ADDR#<BR>
Date/time: #ERROR.DateTime#<BR>
Browser: #ERROR.Browser#<BR>
URL: <a href="http://#CGI.HTTP_HOST##CGI.SCRIPT_NAME##CGI.PATH_INFO#">
http://#CGI.HTTP_HOST##CGI.SCRIPT_NAME##CGI.PATH_INFO#</a><BR>
Request Method: #cgi.REQUEST_METHOD#
<ul>
<li><b>Users Location:</b> #error.remoteAddress#
  <li><b>Users Browser:</b> #error.browser#
  <li><b>Page Refered:</b> #error.HTTPReferer#
</ul>
#error.diagnostics#
<br>
<cfif cgi.REQUEST_METHOD IS "POST">
Form Scope:
<cfdump var="#form#" label="form"><br>
</cfif>
URL Scope:
<cfdump var="#URL#" label="URL"><br>
Session Scope:
<cfdump var="#session#" label="session"><br>
CGI Scope:
<cfdump var="#CGI#" label="CGI"><br>
Request:
<cfdump var="#Request#" label="Request"><br>
CFERROR:
<cfdump var="#cferror#" label="CFERROR Variables."><br>
</CFMAIL>
<!--- end of error email --->
Place static content in here that you want users to see when there is an error. 
I usually put a saved HTML version of the main website with a notice that an error has occured...etc
<CFABORT>

Comments

Brandon,

I have something similar to this, but this seems pretty complete. Thanks for the post!


I was just updating my error mailer when I found this. Thanks for sharing, Brian!


I sometimes email myself 404 errors as well. I use it to identify broken links, hacking attacks, bad search engine spiders etc..


I always send my let my web apps mail me any errors that occur. Even "try and catch" errors.

I believe this is best practice. I usually have a CFC method handle mailing for me.


I used to do this pretty often but one with addition - is to create some kind of threshold. On a number of occaisions where we have a fatal error of sorts - perhaps the database cannot be reached - the last thing you need to add to your woes is your mail client/mailserver being killed because a high traffic website has just spewed thousands of emails another similar suggestion I have come across is actually having an rss feed of (non fatal) errors.


I was just updating my error mailer when I found this. Thanks for sharing, Brian! http://www.qqbq.info/complete.html I believe this is best practice. I usually have a CFC method handle mailing for me.


Flash DVD Ripper is a well-designed dvd ripping program that can convert your favorite DVD movie to MPEG, AVI, VCD, or SVCD images on-the-fly. Flash DVD Ripper supports many important and useful features that include ripping a clip, splitting, etc. Convert DVD to MPEG ; Convert DVD to AVI ; Convert DVD to VCD or SVCD images ; MPEG may be MPEG-1 and MPEG-2 ; Select subtitles and languages ; Choice between PAL and NTSC Split by size or time homepage: http://www.dvd-ripper.com


Audio MP3 WAV WMA OGG Converter Convert Audio Files MP3, WAV, WMA, OGG from One Format to Another Directly. homepage: http://audio-converter.com


I used to do this pretty often but one with addition - is to create some kind of threshold. On a number of occaisions where we have a fatal error of sorts - perhaps the database cannot be reached - the last thing you need to add to your woes is your mail client/mailserver being killed because a high traffic website has just spewed thousands of emails another similar suggestion I have come across is actually having an rss feed of (non fatal) errors. http://vwvw.info/sitemap.htm


 
Page Render Time:218