{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/8087","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/8087/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/8087/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/8087/events","html_url":"https://github.com/joomla/joomla-cms/pull/8087","id":111295339,"number":8087,"title":"Checks J config error_reporting before logging","user":{"login":"digitalgarage","id":9042878,"avatar_url":"https://avatars.githubusercontent.com/u/9042878?v=3","gravatar_id":"","url":"https://api.github.com/users/digitalgarage","html_url":"https://github.com/digitalgarage","followers_url":"https://api.github.com/users/digitalgarage/followers","following_url":"https://api.github.com/users/digitalgarage/following{/other_user}","gists_url":"https://api.github.com/users/digitalgarage/gists{/gist_id}","starred_url":"https://api.github.com/users/digitalgarage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digitalgarage/subscriptions","organizations_url":"https://api.github.com/users/digitalgarage/orgs","repos_url":"https://api.github.com/users/digitalgarage/repos","events_url":"https://api.github.com/users/digitalgarage/events{/privacy}","received_events_url":"https://api.github.com/users/digitalgarage/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/joomla/joomla-cms/labels/PR-staging","name":"PR-staging","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-10-13T23:53:30Z","updated_at":"2015-10-14T21:42:12Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/8087","html_url":"https://github.com/joomla/joomla-cms/pull/8087","diff_url":"https://github.com/joomla/joomla-cms/pull/8087.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/8087.patch"},"body":"Hi Folks,\r\n\r\nCurrently the Joomla JLog class will default to using JLogLoggerMessagequeue class if a custom logger hasn't been added.\r\n\r\nThis means that by default something like: `JLog::add(\"Some logging information here\", JLog::INFO);` will output to the message queue on the front end.  This is done regardless of the error_reporting level defined in the Joomla main config.  So for example even with error_reporting set to none in the Joomla Global Configuration->Server settings error logging done with JLog where a component hasn't defined an alternative logger will print to the message queue.\r\n\r\nThis PR adds a check to the JLogLoggerMessagequeue to ensure that the error reporting level is not none before continuing to log the error.  This will help prevent logging statements appearing on the front end of a site as part of the message queue.\r\n\r\n### To Test ###\r\n\r\nEnsure your error reporting in your Joomla config is set to none.  Then add something like:\r\n\r\n`JLog::add(\"Should this be here\", JLog::INFO); `\r\n\r\nto the top of your templates index.php file and reload the page.\r\n\r\nBefore this patch is applied the following will be displayed on the page refresh.\r\n\r\n![jlog-before](https://cloud.githubusercontent.com/assets/9042878/10471415/ff461ffc-7258-11e5-8c21-cdaa7e0b4dd5.png)\r\n\r\nNow apply the patch and still with error reporting set to none refresh the page.  The log message should now not be present on the site.\r\n\r\n### Comments ###\r\n\r\nI have only tested for error_reporting set to none.  Should this tests for other error_reporting levels?  If so how should we map the JLog levels to the Joomla config levels?\r\n\r\nCheers,\r\nEric.\r\n"},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/148210616","html_url":"https://github.com/joomla/joomla-cms/pull/8087#issuecomment-148210616","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/8087","id":148210616,"user":{"login":"mbabker","id":368545,"avatar_url":"https://avatars.githubusercontent.com/u/368545?v=3","gravatar_id":"","url":"https://api.github.com/users/mbabker","html_url":"https://github.com/mbabker","followers_url":"https://api.github.com/users/mbabker/followers","following_url":"https://api.github.com/users/mbabker/following{/other_user}","gists_url":"https://api.github.com/users/mbabker/gists{/gist_id}","starred_url":"https://api.github.com/users/mbabker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbabker/subscriptions","organizations_url":"https://api.github.com/users/mbabker/orgs","repos_url":"https://api.github.com/users/mbabker/repos","events_url":"https://api.github.com/users/mbabker/events{/privacy}","received_events_url":"https://api.github.com/users/mbabker/received_events","type":"User","site_admin":false},"created_at":"2015-10-14T21:42:12Z","updated_at":"2015-10-14T21:42:12Z","body":"Now that I traced it out I see where you're hitting the issue and it's indeed a bug."}}