[coldbox-5.3.0] cbdebugger not disabled based on environment

I may just have this wrong…but using the default configuration struct, I assume that if “debugMode” is set to false that debugger won’t come up automatically and that is the behavior I want to use in my environment methods in coldbox.cfc so that if the environment is production, then debugger.debugMode = false and in development just the opposite. So to test, I set EVERY occurrence to false thinking it won’t show up at all, reinit, and debugger always shows:

// Debugger Settings
debugger = {
// Activate debugger for everybody
debugMode = false,
// Setup a password for the panel
debugPassword = “”,
enableDumpVar = true,
persistentRequestProfiler = true,
maxPersistentRequestProfilers = 10,
maxRCPanelQueryRows = 50,
showTracerPanel = true,
expandedTracerPanel = true,
showInfoPanel = true,
expandedInfoPanel = true,
showCachePanel = true,
expandedCachePanel = false,
showRCPanel = true,
expandedRCPanel = false,
showModulesPanel = true,
expandedModulesPanel = false,
showRCSnapshots = false,
wireboxCreationProfiler=false
};

function development(){
coldbox.customErrorTemplate = “/coldbox/system/includes/BugReport.cfm”;
coldbox.handlerCaching = false;
debugger.debugMode = false;
};

function production(){
coldbox.customErrorTemplate = “/coldbox/system/includes/BugReport.cfm”;
coldbox.handlerCaching = true;
debugger.debugMode = false;
};

Have you reinitted to pick up the setting? Also most people deal with this a totally different way now. Since we CommandBox as a package manager to handle the dependencies of our app, just install cbdebugger as a development dependency like so

install cbddebugger --saveDev

Now, you should be ignoring the entire modules directory from source control since that folder is managed by CommandBox. When a developer clones your repo, they run

install

which will install all dependencies including development ones. But when your build server goes to build out a production (or test) server, you pull in your dependencies like this:

install --production

which will ignore any development dependencies like the debugger, testbox, or relax, etc. With a setup like this, you can prevent the modules you only use for development to never even get deployed to production at all.

Yes, absolutely re-inited. I’m not sure your response really helps for testing that I can enable and disable the debugger based on environment. I want the debugger in the environment but what you are describing has more to do with how to deploy relative to that environment, not how to test the feature being turned on or off at will.

Mike

That’s correct. I don’t turn debugger on and off on stage. It’s either there or it’s not. I just wanted to make sure you were aware of that process.

Not sure regarding your issue of not being able to turn it off though. Any chance you’re overriding the debugMode setting in the URL or turning it on manually from your code?

Also, another side note regarding your config above. It’s not recommended to have a production() method. Your configure method IS your production settings. You only need to override the other environments.

definitely not using any other method to turn on / off…however, looking at the debug information, it’s claiming the environment to be development so while that is the culprit, I’m still not entirely clear why when I have two distinct host names to test with (.local and .prod). Anyway…your other comments are way more interesting and I’ve wasted too much time trying to make something work that is either not working or not documented properly. I’ll redirect my efforts.

As always, I value your insight and direction Brad, thank you.

Mike