TechnicallyChris.com

Technical and Personal Ramblings of a Bostonian
  • Home
  • About Chris
  • Donate
  • Contact Chris
Home > ColdFusion > Debugging On Demand in ColdFusion

Debugging On Demand in ColdFusion

May 20th, 2006
Goto comments Leave a comment

While I generally do not like to have any type of debugging turned on in a live production environment, for a few Intranet applications, it’s often useful for me to leave debugging on but hidden away. I do this to be able to look at live production page load times, query run times, etc, whenever I need to.

First, there’s my administrator setup. I configure the debugging section so that debugging is enabled, and the “View / Remove Selected IP Addresses for Debug Output” is empty. I use the classic.cfm output format.

Next, there’s the code section. The code is relatively simple and placed in Application.cfm.

1
2
3
4
5
6
7
<cfparam name="variables.debugging_on" default="false" type="boolean">
 
<cfif variables.debugging_on is true>
 <cfsetting enableCFoutputOnly="No" showDebugOutput="Yes">
<cfelse>
 <cfsetting enableCFoutputOnly="No" showDebugOutput="No">
</cfif>

Then there’s just the matter of setting the “debugging_on” variable. You can do this based on just about anything you’d like. For example, you could look at the user who is currently logged in and base it on that. One of my applications is written so that if I am the logged in user, and I put a specific variable in the URL, debugging gets turned on.

Be careful how you output debugging in production, giving the user too much information could be quite dangerous to the security of your application.

If you enjoyed this article or it helped you in any way, I’d appreciate it if you’d post a comment below to let me know. All code examples are for demonstration only and should be used at your own risk. I cannot accept liability for unexpected results.

Chris ColdFusion ColdFusion

Comments (0) Trackbacks (0) Leave a comment Trackback
  1. No comments yet.
  1. No trackbacks yet.
Subscribe to comments feed
Keeping ColdFusion Datasource Names Dynamic Internet Explorer ActiveX Update
RSS feed
  • Google
  • Youdao
  • Xian Guo
  • Zhua Xia
  • My Yahoo!
  • newsgator
  • Bloglines
  • iNezha

Sponsored By

RoboForm: Learn more...Read my review of RoboForm here.

Recent Posts

  • Just Bought the Google Nexus One
  • Seven Things I’ve Liked About Windows 7 in Seven Day
  • What’s Happened to Customer Service (Part 2)?
  • What’s Happened to Customer Service (Part 1)?
  • Capturing S.M.A.R.T. Hard Disk Data from WMI with AutoIt
  • Adjusting DCOM Settings via Script
  • How to Manually Call the Google Cache
  • RoboForm & RoboForm2Go Product Review
  • Updated PingCell Function for Excel
  • Creating Hyperlinks in Word and Excel Longer than 256 Characters

Categories

  • ColdFusion
  • Firefox
  • Google Nexus One
  • IIS
  • McAfee EE / SafeBoot
  • Microsoft Windows
  • Oracle
  • Random Code
  • Random Technology
  • Sports and Recreation
  • Subversion
  • The Untechnological

Archives

  • January 2010
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • October 2007
  • September 2007
  • August 2007
  • January 2007
  • November 2006
  • October 2006
  • September 2006
  • August 2006
  • July 2006
  • June 2006
  • May 2006

Meta

  • Register
  • Log in
PageRank
Top WordPress
Copyright © 2006-2010 TechnicallyChris.com
Theme by mg12. Valid XHTML 1.1 and CSS 3.