You can get an email. See the http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Doentation&file=0 0000242.htm.
Ted Zimmerman
Is there a way in CF7 when an error is generated by a user that they not only receive my "site-wide" error handler but it also would enter that error in to a database table or maybe send me an email? Much obliged...
Is there a way in CF7 when an error is generated by a user that they not only
receive my "site-wide" error handler but it also would enter that error in to a
database table or maybe send me an email?
Much obliged
You can get an email. See the http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Doentation&file=0 0000242.htm.
Ted Zimmerman
Here is a routine that I include in my SiteWide error handler to log
the eror into a database.
<cfif Left(trim(error.diagnostics),4) is 'ODBC' OR
Left(trim(error.diagnostics),5) IS 'OLEDB' OR
Left(trim(error.diagnostics),30) is 'Error Executing Database Query'>
<cfset errorType = "Database Error">
<cfelseif Left(trim(error.diagnostics),17) is 'Request timed out'>
<cfset errorType = "Request Timeout">
<cfelseif error.diagnostics contains 'Error resolving parameter'>
<cfset errorType = "Error Resolving parameter">
<cfelseif error.diagnostics contains 'Error resolving parameter
<B>SESSION.'>
<cfset errorType = "Session Timeout">
<cfelseif Left(trim(error.diagnostics),53) is '<P>An error occured
while evaluating the expression:'>
<cfset errorType = "Error Evaluating Expression">
<cfelseif Left(trim(error.diagnostics),30) is 'Just in time compilation
error'>
<cfset errorType = "Compilation Error">
<cfelse>
<cfset errorType = "Other Error">
</cfif>
<!--- <cfoutput>#errorType#</cfoutput> --->
<cfquery name="InsertLogRecord" Datasource="#DataSource#">
Insert Into errorLog
(
errorStamp,
errorDetail,
errorBase64,
errorType,
template,
queryString,
browser,
remoteAddr,
httpReferer,
application,
server,
scriptName
)
VALUES
(
#CreateODBCDateTime(error.DateTime)#,
'#left(trim(error.diagnostics),2200)#',
'#Trim(Left(ToBase64(error.diagnostics),3000))#',
'#errorType#',
'#error.template#',
'#error.queryString#',
'#error.browser#',
'#error.RemoteAddress#',
'#error.HTTPReferer#',
'#application.applicationName#',
'#cgi.server_name#',
'#CGI.SCRIPT_NAME#'
)
</cfquery>
Allen
Bookmarks