I was needing to do some debugging on a live server today. I had some code that was not performing the way it should have been, so I want to use SeeFusion's trace() method to dump out some information to the debug log so I could find out exactly what line was causing the problem.
Anyway, instead of invoking a reference to the SeeFusion Java object, and manually putting in trace() methods, I thought I'd write up a little CF tag that would manage the creation of the object in the Request scope and dump out the trace methods for me, as I felt this would speed up being able to quickly insert a SeeFusion trace.
There's nothing fancy going on here, but I thought I'd just share the tag in case it saves anyone some time. I'd recommend saving this file as "seefusion.cfm" in your default ColdFusion Custom Tag directory. That will make it available to any template without having to worry about any mappings.
This code will only initiate the SeeFusion Java object once per page request. It'll also throw an error if the SeeFusion isn't found. To use the code, just put the following line in your code:
<cf_seefusion trace="Hello World!">
To view the trace information, you'll need to log in to the SeeFusion web page and click on one of the Debug links at the bottom of the page. Any calls to the <cf_seefusion> tag will now pop up in the Debug window.
This feature is very nice because the information is hidden from the users, but allows you to see what's going on. Plus, it allows you to monitor threads from other users—which is something you couldn't do if the trace information was only displayed to the active user.
So far SeeFusion has proved extremely useful.
Comments for this entry have been disabled.