I ended up writing my own stuff to accomplish this.  It's not too tough,
just grab the error output and dump it into a table.

<cfset securepage = 0>
<cfinclude template="#baseroot#/include/template_topper.cfm">
<!---
error.cfm - 11/4/2003 PBR
Global error handling page.  Dumps all debug information into the
database.

--->
<cfoutput>
<!--- Build the debug information --->
<cfscript>
tmp = structNew();

tmp.date_time = error.datetime;
tmp.message = error.message & " (" & error.rootCause.tagContext[1].ID
& "/" & error.rootCause.tagContext[1].TYPE & ")";
tmp.diag_info = error.diagnostics;
tmp.file_location = error.rootCause.tagContext[1].TEMPLATE & "|" &
error.rootCause.tagContext[1].LINE & "|" &
error.rootCause.tagContext[1].COLUMN;
tmp.server = CGI.http_host;
tmp.data_pkg = error;

tmp.full_scope_pkg = structNew();
tmp.full_scope_pkg.http = structNew();
tmp.full_scope_pkg.http = getHTTPRequestData();
tmp.full_scope_pkg.cgi = structNew();
tmp.full_scope_pkg.cgi = cgi;
tmp.full_scope_pkg.server = structNew();
tmp.full_scope_pkg.server = server;
tmp.full_scope_pkg.application = structNew();
tmp.full_scope_pkg.application = application;
tmp.full_scope_pkg.request = structNew();
tmp.full_scope_pkg.request = request;
tmp.full_scope_pkg.session = structNew();
tmp.full_scope_pkg.session = session;
tmp.full_scope_pkg.url = ""> tmp.full_scope_pkg.url = ""> tmp.full_scope_pkg.client = structNew();
tmp.full_scope_pkg.client = client;
tmp.full_scope_pkg.form = structNew();
tmp.full_scope_pkg.form = form;

tmp.scope_pkg = tmp.full_scope_pkg;
</cfscript>
<!--- Convert structures to WDDX --->
<cfwddx action="" input="#tmp.data_pkg#"
output="tmp.data_pkg_out" usetimezoneinfo="Yes">
<cfwddx action="" input="#tmp.scope_pkg#"
output="tmp.scope_pkg_out" usetimezoneinfo="Yes">
<!--- Insert data --->
<cftransaction action=""> <cfquery name="insError" datasource="#thedatasource#">
INSERT INTO
tblErrors(date_time,message,diag_info,file_location,server,data_pkg,scope_pkg)
VALUES
(#tmp.date_time#,'#tmp.message#','#tmp.diag_info#','#tmp.file_location#','#tmp.server#','#tmp.data_pkg_out#','#tmp.scope_pkg_out#')
</cfquery>
<cfquery name="getID" datasource="#thedatasource#">
SELECT @@identity AS tmp_id
</cfquery>
</cftransaction>
<script language="_javascript_" type="text/_javascript_">
<!--
function errorNav(item) {
if (item.a[0].checked == true) {
history.go(-1);
return false;
} else if (item.a[1].checked == true) {
location.href='';
return false;
} else {
item.submit();
return true;
}
}
//-->
</script>
<!--- #getID.tmp_id# --->
<h1>An error has occurred.</h1>

<p><em>#tmp.message#</em>
<cfif CGI.server_name CONTAINS "localhost">
<blockquote>
<h2>Diagnostic information:</h2>
<p><em>#tmp.diag_info#</em></p>
<p><em>#tmp.file_location#</em></p>
</blockquote>
</cfif>
</p>

<p>There has been a problem with the request that you are trying to
make.  You have several options:</p>
<blockquote>
<form name="error" id="error" action="" method="get"
errorNav(document.error)">
<input type="hidden" name="id" value="#getID.tmp_id#">
<input type="radio" name="a" id="a_try_again" value="try_again"
checked="checked"><label for="" Return to the previous page
and try again.</label><br />
<input type="radio" name="a" id="a_cancel" value="cancel"><label
for="" Cancel and return to the events listing.</label><br />
<input type="radio" name="a" id="a_submit_help"
value="submit_help"><label for="" Cancel and submit a help
request.</label><br /><br />

&nbsp; &nbsp; &nbsp; <input type="submit" value="Submit"> &nbsp;
<input type="reset" value=" Reset ">

</form>
</blockquote><br><br>

</cfoutput>
<cfinclude template="#baseroot#/include/template_footer.cfm">

Bernd VanSkiver wrote:
> Does anyone know of a way to have ColdFusion log to a database instead of to
> files?  I am just looking at options of keeping watch on multiple ColdFusion
> server logs to watch for errors that occur.
>
> Bernd VanSkiver
> [EMAIL PROTECTED]
> 801.520.5957
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to