2

I would like to use the ColdFusion Request Debugging Output from the context of my CFC web service. Is this possible? Here is a sample CFC that I've tried to access:

/cfjunk/jsonBug.cfc:

<cfcomponent output="true">

<cffunction name="test" returntype="string" access="remote" returnformat="json" output="true">
    <cfset local.str = structNew()>
    <cfsetting showDebugOutput= "true">
    <cfscript>
    str = {a = "hello", b = JavaCast("int", 23)};
    </cfscript>
    <cfreturn SerializeJSON(local.str)>
</cffunction>

</cfcomponent>

Requested via http://localhost:8500/cfjunk/jsonBug.cfc?method=test with Request Debugging turned on, yielding no actual debugging output. As you can see, I've tried to force the issue by specifying showDebuggingOutput="true", to no avail.

8
  • What browser are you using? Also, does the /cfjunk have an Application.cfc in it? If not, is there an Application.cfc in the root? Does it possibly have debugging forcibly off, and are you further not destroying the REQUEST scope within onRequest()? Commented Jan 10, 2012 at 22:52
  • 1
    Using Chrome, although I'd be surprised if that was a factor. There is no Application.cfc in either cfjunk or the root folder. Are you asking because you have gotten debugging output working in this context? I saw your earlier answer, and it sounded reasonable. Something change your mind? Commented Jan 10, 2012 at 23:21
  • Yes, I copied your code line-for-line and put it into a /services directory within my local working cfserver and not only am getting coldfusion debugging output to the screen--I can't seem to forcibly shut it off/suppress it, without disabling debugging in the CFAdmin--still looking... Commented Jan 10, 2012 at 23:31
  • Ok, I removed your line of <cfsetting showDebugOutput= "true"> and that disabled debugging on my view, which means that you have something post-processing, which is shutting debugging off before the result hits your browser--still looking... Commented Jan 10, 2012 at 23:34
  • Hm, I even changed JVMs and it is still outputting debugging to the screen--are you certain debugging is enabled in the CFAdmin? I realize that sounds silly but it appears that nothing should really prevent it (other than a rogue cfsetting showdebugoutput=false somewhere)--even this guy has the opposite problem: stackoverflow.com/questions/2561010/… Commented Jan 10, 2012 at 23:47

1 Answer 1

2

The behavior of debugging output in ColdFusion, within the context of direct CFC calls is slightly different between versions.

The latest version, ColdFusion 9.0.1, suppresses this debug information from the browser output. Therefore, you'll need another mechanism to debug CFCs directly, either by tracing/tailing the log, encapsulating all the CFC calls within a CFM that you can successfully display debugging output on, or opt to use an external debugger to monitor the calls, ie. Firebug, Chrome Developer Tools or Charles.

In ColdFusion 8 and earlier, as well as the un-hotfixed ColdFusion 9.0, this debug information is displayed in the browser output.

Source: Change in CFCs with Debugging and ColdFusion 9

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.