turn off debug

I have been researching this for quite a while now, and no matter what
I do I can not seem to turn debugging on and off via url parameters.

not sure how to trouble this, but I do not have a password set, and I
am using the example params for the url:

?debugmode=false

never works.

I’ve had this on occasion though I’ve never figured out what the cause was.

Dustin

Hmm, never seen that before. The debug mode uses a vapor cookie on your browser, check if the cookie is being set.

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

the cookie gets created however, it never seems to do anything :frowning:

Weird, I can’t reproduce this though, something has to be weird there.

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

I had to add a block to my config.cfc to fix this

if(
isDefined(“url.fwreinit”) AND
url.fwreinit Eq sSetting.AppCore.AppKey AND
isDefined(“url.debugmode”) AND
isBoolean(url.debugmode) AND
isDefined(“url.debugpassword”) AND
url.debugpassword Eq sSetting.AppCore.AppKey
){
sSetting.AppDevMode.AppDebugMode=url.debugmode;
}

I use a struct to set the settings inside of the config file read from an ini file

Chris Hough

@Luis and company, here is what my full config looks like, I had to
use the URL section above to get this to work as intended:

<!---
  structures/arrays to create for configuration

  - coldbox (struct)
  - settings (struct)
  - conventions (struct)
  - environments (struct)
  - ioc (struct)
  - models (struct)
  - debugger (struct)
  - mailSettings (struct)
  - i18n (struct)
  - bugTracers (struct)
  - webservices (struct)
  - datasources (struct)
  - layoutSettings (struct)
  - layouts (array of structs)
  - cacheBox (struct)
  - interceptorSettings (struct)
  - interceptors (array of structs)
  - modules (struct)
  - logBox (struct)

  Available objects in variable scope
  - controller
  - logBoxConfig
  - appMapping (auto calculated by ColdBox)

  Required Methods
  - configure() : The method ColdBox calls to configure the
application.
  Optional Methods
  - detectEnvironment() : If declared the framework will call it and it
must return the name of the environment you are on.
  - {environment}() : The name of the environment found and called by
the framework.

--->
<cfcomponent output="false" hint="My App Configuration" >

  <cffunction name="GetAppShared" access="private" output="false"
returntype="struct">
    <cfscript>
      var sSetting=StructNew(); //ast = application shared struct
      // Application INI Data
        sSetting.AppIniData=StructNew();
        sSetting.AppIniData= GetApplicationConfig(
          ConfigFilename="ApplicationConfig.cfm",
          ConfigFileLine="32",
  
ConfigNames="ApplicationMode,AppDomain,UrlAddress,SecondaryUrlAddress,BugTracers,BugTracerTo,BugTracerFrom"
        );
      //************CORE Application
Settings*************************************
        sSetting.AppCore=StructNew();
        sSetting.AppCore.AppName="AppName";
  
sSetting.AppCore.AppDomain=sSetting.AppIniData.AppIniData.AppDomain;
  
sSetting.AppCore.AppFullDomain=sSetting.AppIniData.AppIniData.UrlAddress;
        sSetting.AppCore.AppCfcPathName="AppCfcPathName";
        sSetting.AppCore.AppKey=DateFormat(now(),"yyyymmdd");
        sSetting.AppCore.DebugPassword=sSetting.AppCore.AppKey;
        sSetting.AppCore.ReInitPassword=sSetting.AppCore.AppKey;
        sSetting.AppCore.BackwardsCompatible=false;

        sSetting.AppCore.Database=StructNew();
        sSetting.AppCore.Database.name="pcmenu";
        sSetting.AppCore.Database.datasource="pcmenusqldev";
        sSetting.AppCore.Database.dbType="";
        sSetting.AppCore.Database.username="";
        sSetting.AppCore.Database.password="";

        //application encryption settings use for encrypting any data
        sSetting.AppCore.AppEncrypt.Encryption=true;
        sSetting.AppCore.AppEncrypt.Seed=hash("MallfinderRetailHub" &
sSetting.AppCore.AppKey);
        sSetting.AppCore.AppEncrypt.Algorithm="CFMX_COMPAT";
        sSetting.AppCore.AppEncrypt.Encoding="Base64";

        //cookie settings, as cookies are added to the system, this list
is used for debugging and clearing cookies on log out, do not remove
the base cbstorage
        sSetting.AppCore.CookieList="cbStorage" & "," &
sSetting.AppCore.AppName;
  
sSetting.AppCore.CookieSetting.CookieEncryption=sSetting.AppCore.AppEncrypt.Encryption;
  
sSetting.AppCore.CookieSetting.CookieSeed=sSetting.AppCore.AppEncrypt.Seed;
  
sSetting.AppCore.CookieSetting.CookieAlgorithm=sSetting.AppCore.AppEncrypt.Algorithm;
  
sSetting.AppCore.CookieSetting.CookieEncoding=sSetting.AppCore.AppEncrypt.Encoding;

        //what version of coldbox are we running, all coldbox specific
framework data
        sSetting.AppCore.ColdBox=StructNew();
        sSetting.AppCore.ColdBox.Version="Coldbox 3.10";
        sSetting.AppCore.ColdBox.Website="http://coldbox.org/";
        sSetting.AppCore.ColdBox.Documentation="http://wiki.coldbox.org/
wiki/Dashboard.cfm";

        // get all of the server operating system information
        sSetting.AppServerInfo=GetServerInfo();
  
sSetting.AppServerInfo.ApplicationPath=sSetting.AppServerInfo.AppBasePath
& sSetting.AppCore.AppName &
sSetting.AppServerInfo.AppFilePathSeparator;
        // get base application data, hard coded xml data files, may
change to queries later
        sSetting.AppData=StructNew();
        sSetting.AppData.AppDataFilePath=ExpandPath("../") &
sSetting.AppCore.AppName & sSetting.AppServerInfo.AppFilePathSeparator
& "data" & sSetting.AppServerInfo.AppFilePathSeparator;
        // setup the log files
        sSetting.AppLogs=StructNew();
        sSetting.AppLogs.AppLogFileName="RetailHub";
        sSetting.AppLogs.AppLogFilePath=ExpandPath("../") &
sSetting.AppCore.AppName & "logs";
      // which environment are we working in
      sSetting.AppDevMode=StructNew();
      switch (sSetting.AppIniData.AppIniData.ApplicationMode){
        case "Production": {
          //----------------------------------------------------------------------------------------------------------------------------------------
          // PRODUCTION
          //----------------------------------------------------------------------------------------------------------------------------------------
          sSetting.AppCore.AppMode="Production";
          sSetting.AppDevMode.AppDebugMode=false;
          //Application Aspects : Production false,true,true,true ::
Development true,false,false,false
          sSetting.AppDevMode.configAutoReload=false;
          sSetting.AppDevMode.handlerCaching=true;
          sSetting.AppDevMode.handlersIndexAutoReload=false;
          sSetting.AppDevMode.eventCaching=true;
          sSetting.AppDevMode.methodOutput=false;
          sSetting.AppDevMode.proxyReturnCollection=true;
          sSetting.AppDevMode.flashURLPersistScope="session";
          //modules
          sSetting.AppDevMode.modulesAutoReload=false;
          //Error/Exception Handling
          sSetting.AppDevMode.defaultLogLevel=0;
          sSetting.AppDevMode.enableDumpVar=true;
          sSetting.AppDevMode.exceptionHandler="";
          sSetting.AppDevMode.onInvalidEvent="";
          sSetting.AppDevMode.customErrorTemplate="";
          break;}
        case "Testing": {
          //----------------------------------------------------------------------------------------------------------------------------------------
          // TESTING
          //----------------------------------------------------------------------------------------------------------------------------------------
          sSetting.AppCore.AppMode="Testing";
          sSetting.AppDevMode.AppDebugMode=true;
          //Application Aspects
          sSetting.AppDevMode.configAutoReload=true;
          sSetting.AppDevMode.handlerCaching=false;
          sSetting.AppDevMode.handlersIndexAutoReload=true;
          sSetting.AppDevMode.eventCaching=false;
          sSetting.AppDevMode.methodOutput=false;
          sSetting.AppDevMode.proxyReturnCollection=true;
          sSetting.AppDevMode.flashURLPersistScope="session";
          //modules
          sSetting.AppDevMode.modulesAutoReload=true;
          //Error/Exception Handling
          sSetting.AppDevMode.defaultLogLevel=1;
          sSetting.AppDevMode.enableDumpVar=true;
          sSetting.AppDevMode.exceptionHandler="";
          sSetting.AppDevMode.onInvalidEvent="";
          sSetting.AppDevMode.customErrorTemplate="";
          break;}
        case "Development": {
          //----------------------------------------------------------------------------------------------------------------------------------------
          // DEVELOPMENT
          //----------------------------------------------------------------------------------------------------------------------------------------
          sSetting.AppCore.AppMode="Development";
          sSetting.AppDevMode.AppDebugMode=true;
          //Application Aspects
          sSetting.AppDevMode.configAutoReload=false;
          sSetting.AppDevMode.handlerCaching=false;
          sSetting.AppDevMode.handlersIndexAutoReload=true;
          sSetting.AppDevMode.eventCaching=false;
          sSetting.AppDevMode.methodOutput=true;
          sSetting.AppDevMode.proxyReturnCollection=true;
          sSetting.AppDevMode.flashURLPersistScope="session";
          //modules
          sSetting.AppDevMode.modulesAutoReload=true;
          //Error/Exception Handling
          sSetting.AppDevMode.defaultLogLevel=1;
          sSetting.AppDevMode.enableDumpVar=true;
          sSetting.AppDevMode.exceptionHandler="";
          sSetting.AppDevMode.onInvalidEvent="";
          sSetting.AppDevMode.customErrorTemplate="";
          break;}
      }
      if(
          isDefined("url.fwreinit") AND
          url.fwreinit Eq sSetting.AppCore.AppKey AND
          isDefined("url.debugmode") AND
          isBoolean(url.debugmode) AND
          isDefined("url.debugpassword") AND
          url.debugpassword Eq sSetting.AppCore.AppKey
        ){
        sSetting.AppDevMode.AppDebugMode=url.debugmode;
      }
      return sSetting;
    </cfscript>
  </cffunction>
  <!---

?debugmode=true&debugpass=@pass@

This will turn in on if you are using a debug password, which it looks like you do based on below.

Curt

do I have to include the “@” around the password when passed in the url?

No, sorry, that was just to indicate it was a variable.

Curt

oh, I tried that multiple times correctly, and it would never shut off, ever.

I noticed the config caching was set to false, changing it had no affect

Chris Hough

Is event caching enabled? Would that setting affect anything?

Nolan Dubeau

Load *.*,8,1

event caching is set to false

any thoughts?

I don’t have anything new to add that could solve it.

For me, I know I have to run the “?debugmode=true&debugpass=secret” two times to enable and two times to disable. Perhaps you just need to run the command twice like me?

-A

I hear you, thank you man.

I just wish I could remove that if statement in my config

That was a bug in 3.0 though

Luis -

Am I crazy or is still a bug in the current version?

I am holding off upgrading to 3.5 until it’s out of beta.

Hi Chris, I can get in and out of debug mode with once time now.

3.5 should be final in the repo unless we get more bug fixes?

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

I will let you know if this goes away in 3.5, but I wonder if it has to do with how I am setting up my config.cfc.

hmmm…