Escape Keys - TomdeMan's Blog
BugLog and Coldbox Plugin

If you have heard of BugLogHQ, a nice centralized bug reporting application, written by Oscar Arevalo, and you want to integrate it with your Coldbox apps, then this article is for you.

Let's get started...

Be sure to set the Exception Handler in either the Coldbox config or your Environments.xml. For reference, 'main' is my handler and 'onException' is the method or event. By default, the value is blank in the config.

<Setting name="ExceptionHandler"         value="main.onException" />

Next, you need to add the WSDL URL to your Coldbox config file or your Environments.xml.

<Setting name="BugLogWSDL"                   value="http://bugs.mysite.com/listeners/bugLogListenerWS.cfc?wsdl" />

@UPDATE - ** WEBSERVICE PLUGIN UPDATED **

Now, go to that Exception Handler method we defined in the first step. Copy and paste this in there.

@UPDATE - UPDATED CODE HERE

Finally, create the BugLog.cfc and place it in your Plugins directory ('plugins' by default unless you specified otherwise in your CONVENTIONS).

Here's the code.

@UPDATE - UPDATED CODE HERE

That's it.

Now, Coldbox will deliver Bug Reports to the BugLog system, in addition to the internal Bug Reporting setting. If you don't want to use CB to deliver Email Reports then be sure to define that in your config or environments.xml.

<Setting name="EnableBugReports"          value="false" />

Comments:

[Add Comment]

Oscar Arevalo says:

Nice! one suggestion though, for the hostname attribute in the webservice call, if you are deploying to a clustered/load balanced environment you may want to consider getting the hostname using Java, as in:

<code>
hostname = CreateObject("java", "java.net.InetAddress").getLocalHost().getHostName();
</code>

This is because in clustered/load balanced environments most likely all boxes will share the same value for cgi.http_host

Other than that, great work! I always wanted to create a coldbox plugin for BugLog but seems you beat me to the punch!

7/7/08 10:40 PM

Rob Gonda says:

another small suggestion is to store the instance of the initialized web service...I'm not sure about the performance implications of creating a new object every time, but try looping a few thousand times with cfinvoke and compare it to the same look over some application.ws which stores a WS you created with createObject.

I would only affect the app if you throw massing errors, for instance if google hits a broke page, you would be amazed how much traffic it can generate.

7/8/08 12:31 AM

[Add Comment]