Visit the ColdFusionProNews Directory
Beginners
Installation, Coding Techniques, Data Structures...
CF Powered Sites
Stores, Directories, Universities...
Developers
Developers, Designers, Experts...
E-commerce
Shoes, Food, Music...
Education
Books, Online Resource, Languages...
Expert
LiveChat , CFX XMLParser , User Defined Function Library...
Hosting
Dedicated Servers, Virtual Server, Multi-user...
Intermediate
AutoResize , DataSource Encryption, Guestbook...

Submit your site for FREE

Implementing Railo Effectively As A Developer


By: Raymond Camden

There are multiple methods of debugging applications, including the very cool FusionDebug, log files, ServiceCapture, and the debugging rolled into Flex Builder 2 itself.

Here is a quick tip for another method to use. It's ugly - but effective.

Modify your onError to dump the errors and log to a file like so:

<cffunction name="onError" returnType="void" output="false">
   <cfargument name="exception" required="true">
   <cfargument name="eventname" type="string" required="true">
   <cfset var temp = "">

   <cflog file="my app" text="#arguments.exception.message#, #arguments.exception.detail#">
   <cfsavecontent variable="temp">
   <cfdump var="#arguments#">
   </cfsavecontent>
   <cffile action="write" file="c:kuler.html" output="#temp#">
   <cfdump var="#arguments#"><cfabort>
</cffunction>


I wrapped a dump of the arguments (which contain my exception) and simply save it to the C drive as an HTML file. I then have this file open in my browser.

As I debug, I can simply reload the tab in Firefox to see what the latest error was.

I find this especially useful when the exception message is a bit too vague.

With the dump I get the full trace of files where the error occurred.

Let me be absolutely clear: Do not use this code in production. It isn't nice. It doesn't play well with others. It runs with scissors.

You get the idea. But I thought I'd share.

Comments

Tag: ,

Digg | Reddit | Furl

Bookmark WebProNews:

About The Author

Raymond Camden, ray@camdenfamily.com
http://ray.camdenfamily.com

Raymond Camden is Vice President of Technology for roundpeg, Inc. A long time ColdFusion user, Raymond has worked on numerous ColdFusion books and is the creator of many of the most popular ColdFusion community web sites. He is an Adobe Community Expert, user group manager, and the proud father of three little bundles of joy.