Manipulate the Admin Debug Settings
Here's a handy UDF which you can use to turn on and off the Admin debug and robust exception settings.
<cffunction name="enableDisableDebugging" output="false" returntype="void" hint="I enable/disable debugging settings">
<cfargument name="status" type="string" required="true" />
<cfset var objDebugServiceFactory=createobject("java","coldfusion.server.ServiceFactory").getDebuggingService()>
<cfif arguments.status EQ "enable">
<cfif not objDebugServiceFactory.isEnabled()>
<cfset objDebugServiceFactory.setEnabled(true)>
<cfset objDebugServiceFactory.setRobustEnabled(true)>
</cfif>
<cfelseif arguments.status EQ "disable">
<cfif objDebugServiceFactory.isEnabled()>
<cfset objDebugServiceFactory.setEnabled(false)>
<cfset objDebugServiceFactory.setRobustEnabled(false)>
</cfif>
</cfif>
</cffunction>
Then you need to turn on/off the setting with the following in your code...
<cfoutput>#enableDisableDebugging('enable')#</cfoutput>
