debug_to_log() always active?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
User avatar
creopard
Forum Members
Forum Members
Posts: 47
Joined: Fri Nov 10, 2017 10:25 am
Location: .de
Contact:

debug_to_log() always active?

Post by creopard »

Hello,

today, I noticed the file in /tmp/cache/debug.log with today's timestamp.
Since I do not have debug_to_log enabled in the config.php, I wondered, why this file was created anyways.

I found the function in /lib/misc.functions.php with that condition:

Code: Select all

function debug_to_log($var, $title='',$filename = '')
{
    $config = \cms_config::get_instance();
if( $config['debug_to_log'] || (function_exists('get_userid') && get_userid(FALSE)) ) {
This condition is concatenated by "||" (OR) but what is "get_userid()" used for?
Does that mean, the debug.log gets created even it's NOT activated in the config.php file?
User avatar
creopard
Forum Members
Forum Members
Posts: 47
Joined: Fri Nov 10, 2017 10:25 am
Location: .de
Contact:

Re: debug_to_log() always active?

Post by creopard »

No none got any idea?
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1922
Joined: Mon Jan 29, 2007 4:47 pm

Re: debug_to_log() always active?

Post by Jo Morg »

As long as there is someone logged in in the backend, yes, there are a few debug_to_log calls that may still be active in the core and possibly in other 3rd party modules that will create entries for those specific users both in frontend and backend actions. The config entry only affects frontend actions from regular site visitors to prevent it's growth without any particular debugging purpose. Although this as been like that since, well, almost for ever :) I think it's a legit use. We may revise that policy in the future though, if it interferes with a site's performance in any way.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
User avatar
creopard
Forum Members
Forum Members
Posts: 47
Joined: Fri Nov 10, 2017 10:25 am
Location: .de
Contact:

Re: debug_to_log() always active?

Post by creopard »

Thanks for clearing this up, so "get_userid(FALSE)" refers to a logged in user in the admin section?
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1922
Joined: Mon Jan 29, 2007 4:47 pm

Re: debug_to_log() always active?

Post by Jo Morg »

That's exactly right!
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Post Reply

Return to “CMSMS Core”