I'd like to display cf errors via the Site-wide Error Handler setting in CF Administrator but we also wish to log the cf error to the application.log file, that is, the way it's logged if there was no error handler file. Or something just as easy and direct. I know how to do one at a time, no problem, but not both at the same time. I know I can limit the amount of error message the user normally sees if the standard error is shown, but I want to see the full error. And I know I can mail the error to me but that's not practical. I need practical.
I'd rather not turn on ip address debugging. Too messy. I'm also aware of the individual debugging options in CF Admin and have a basic idea of my selections there but I don't see anything which will do what I want, display to the user, and write to application.log. Patching tons of code with CFTRY/CFCATCH, CFERROR or a similar method into hundreds of pages of code is out of the question. There should be a way to display the both but I don't see such an option. Perhaps the following code will do this system wide?
I was working with the following code, placed directly into the Site-wide Error Handler file displayed to everyone, but limiting display of cfdump to admin only via the cfif admin_ip. Again, this is in the error handling file defined in cf administrator.
Should I be able to use this to append errrors to the application.log file, and if so, how should I modify this code to make it work? We're using Coldfusion 5 server and SQL 2000 and application.log is stored in c:/cfusion/logs/. I know how to display that log file. That's not the problem. I suppose I can append the output to a log of my choice and clean this up and perhaps that will do it. What do you think? Can someone clean this up a bit and make suggestions, that is, if there is no other way to get done what I need?
Here's the current basic code:
There was an error. Please try again or <a href="/contact/admin.cfm">
report</a>
to the website administrator.
<CFIF ADMIN_IP>
<CFDUMP var="#error#">
<CFIF IsDefined('form')>Form<CFD
UMP var="#form#"></CFIF>
<CFIF IsDefined('url')>Url<CFDUM
P var="#url#"></CFIF>
<CFIF IsDefined('session')>Sessi
on<CFDUMP var="#session#"></CFIF>
<CFIF IsDefined('application')>A
pplication
<CFDUMP var="#application#"></CFIF
>
</CFIF>
Start Free Trial