We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37984
    • 215 Posts
    Thanks for the clarification, BobRay - in the process of checking them all now. Will update soon.
      Jesse Couch
      MODX Aficionado, Front-End Designer & Developer
      http://www.designcouch.com
      • 37984
      • 215 Posts
      Ok - still need to bump this. I am getting multiple different extras generating errors, but the largest are mxCalendar and getResources. The odd thing is, I have these installed elsewhere with the same version of MODX and these errors are not present. This leads me to believe that it may be something to do with my particular install of MODX on this server. I tried re-installing and running setup, and neither worked. Please help, folks. This is going to delay the launch of my site if I can't figure it out. Thanks in advance!
        Jesse Couch
        MODX Aficionado, Front-End Designer & Developer
        http://www.designcouch.com
        • 3749
        • 24,544 Posts
        If you have an editor that will do multi-file searches on a particular directory (I believe the free NetBeans editor would do this if you don't have one -- the free trial version of PhpStorm will for sure, though you'd have to create a project based on your MODX install), search the core/components directory for setLogLevel. That should show you who is messing with the log level.

        Another thought: The correct method of setting the log level is

        setLogLevel(modX::LOG_LEVEL_ERROR);


        or

        setLogLevel(xPDO::LOG_LEVEL_ERROR);


        It's possible that with an Extra using the old method, using a malformed value, or misspelling the constant (LOG_LEVEL_INFO), the constant could be misinterpreted.

        As a last resort, you could try adding this line to the index.php file in the root:

        $modx->setLogLevel(modX::LOG_LEVEL_ERROR;


        That might turn it off except for the offending extra.

        [ed. note: BobRay last edited this post 13 years, 8 months ago.]
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          I always liked the Crimson Editor for Windows, it's quite powerful for a relatively simple editor.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 37984
            • 215 Posts
            Not on a Windows machine, and my dev environment is online, so I can't install these programs. As an alternative, I copied the core/components folder to my desktop and then ran a Spotlight search through it (on a Mac). It appears that multiple extras are invoking "setLogLevel". They're listed below. I'm in the process of seeing if any of them have setLogLevel set to debug.


            • Big Brother
            • Gallery
            • FormIt
            • Localweather
            • mxCalendar
            • phpThumbOf
            • Quip
              Jesse Couch
              MODX Aficionado, Front-End Designer & Developer
              http://www.designcouch.com
              • 37984
              • 215 Posts
              On further investigation, it seems that Localweather and phpThumbOf are both using this line of code:

              $this->modx->setLogLevel(modX::LOG_LEVEL_DEBUG);


              However, I'm not entirely certain if either applies it by default, or if this line in include simply to invoke a debug mode on request. Anyone know how to tell?
                Jesse Couch
                MODX Aficionado, Front-End Designer & Developer
                http://www.designcouch.com
                • 37984
                • 215 Posts
                I just disabled localweather, cleared the cache and the browser cache, and flushed all sessions. Upon login, the error has disappeared, so localweather is obviously the culprit. Now to fix the extra - anyone have any idea if modifying from:

                public function __construct(modX &$modx, array &$config)
                	{
                		$this->modx =& $modx;
                		$this->modx->setLogLevel(modX::LOG_LEVEL_DEBUG);
                		$this->modx->lexicon->load('localweather:default');
                
                		// Force all parameters to lowercase
                		$config = array_change_key_case($config, CASE_LOWER);
                
                		// Get MODx Manager settings
                		$settings = $this->modx->newQuery('modSystemSetting')->where(
                			array('key:LIKE' => $this->namespace . '%')
                		);
                		$settings = $this->modx->getCollection('modSystemSetting', $settings);
                		
                		// Apply MODx manager settings
                		foreach($settings as $key => $setting) {
                			$key = str_replace($this->namespace, '', $key);
                
                			// Don't overwrite snippet params
                			if(empty($config[$key]) OR $config[$key] === NULL)
                				$config[$key] = $setting->get('value');
                		}
                
                		// Merge snippet parameters and system settings with default config
                		$this->config = array_merge($this->config, $config);
                	}


                To this:

                public function __construct(modX &$modx, array &$config)
                	{
                		$this->modx =& $modx;
                		$this->modx->setLogLevel(modX::LOG_LEVEL_ERROR);
                		$this->modx->lexicon->load('localweather:default');
                
                		// Force all parameters to lowercase
                		$config = array_change_key_case($config, CASE_LOWER);
                
                		// Get MODx Manager settings
                		$settings = $this->modx->newQuery('modSystemSetting')->where(
                			array('key:LIKE' => $this->namespace . '%')
                		);
                		$settings = $this->modx->getCollection('modSystemSetting', $settings);
                		
                		// Apply MODx manager settings
                		foreach($settings as $key => $setting) {
                			$key = str_replace($this->namespace, '', $key);
                
                			// Don't overwrite snippet params
                			if(empty($config[$key]) OR $config[$key] === NULL)
                				$config[$key] = $setting->get('value');
                		}
                
                		// Merge snippet parameters and system settings with default config
                		$this->config = array_merge($this->config, $config);
                	}


                would be detrimental to the extra or my MODX install? (the important part is line 4, but I wanted to provide the context for that line by including the rest of the code around it)
                  Jesse Couch
                  MODX Aficionado, Front-End Designer & Developer
                  http://www.designcouch.com
                  • 37984
                  • 215 Posts
                  I have reported this issue on the extra's github page, and will wait to hear replies on the above. Thanks for all your help, folks!
                    Jesse Couch
                    MODX Aficionado, Front-End Designer & Developer
                    http://www.designcouch.com
                    • 3749
                    • 24,544 Posts
                    I suspect that the developer just forgot to make that change before releasing it (it's happened to me more than once). I can't imagine any App that *needs* to be run with debug on.

                    I think this would be a more correct fix:

                    $this->modx =& $modx;
                    // $this->modx->setLogLevel(modX::LOG_LEVEL_DEBUG);
                    $this->modx->lexicon->load('localweather:default');


                    That way, if you ever really need debug on, the Extra won't turn it off.

                    FYI, if debug needs to be on for some reason, the correct way to do it is this:

                    $originalDebugLevel = $this->modx->setLogLevel(modX::LOG_LEVEL_DEBUG);


                    Then, after the section that needs debug:

                    $this->modx->setLogLevel($originalDebugLevel);


                    If the code were not inside a PHP class, you'd remove 'this=>' and it would just be $modx->setLogLevel( . . .)
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                      • 34084 ☆ A M B ☆
                      • 756 Posts
                      @designcouch, sorry it was a rogue setting in one of the snippets that was setting the log level to debug for modx thus adding all the entries. I've remove it from that extra and the log is now clean. Sorry everyone.

                      Cheers
                        Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
                        Visit CharlesMx.com for latest news and status updates.