{"action":"opened","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/17972","repository_url":"https://api.github.com/repos/joomla/joomla-cms","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/17972/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/17972/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/17972/events","html_url":"https://github.com/joomla/joomla-cms/issues/17972","id":258241161,"number":17972,"title":"Extending Joomla! Logger Using jimport('joomla.log.log') in script.php of custom compontent crashes installation, update and uninstallation","user":{"login":"avjoomla","id":5906911,"avatar_url":"https://avatars2.githubusercontent.com/u/5906911?v=4","gravatar_id":"","url":"https://api.github.com/users/avjoomla","html_url":"https://github.com/avjoomla","followers_url":"https://api.github.com/users/avjoomla/followers","following_url":"https://api.github.com/users/avjoomla/following{/other_user}","gists_url":"https://api.github.com/users/avjoomla/gists{/gist_id}","starred_url":"https://api.github.com/users/avjoomla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avjoomla/subscriptions","organizations_url":"https://api.github.com/users/avjoomla/orgs","repos_url":"https://api.github.com/users/avjoomla/repos","events_url":"https://api.github.com/users/avjoomla/events{/privacy}","received_events_url":"https://api.github.com/users/avjoomla/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-16T16:13:40Z","updated_at":"2017-09-16T16:13:40Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I use the Joomla! Logger in the installation script file of a custom Joomla! component (Visforms), in order to write a log file.\r\nI use the following Code to include the Joomla! Logger and extend the JLogLoggerFormattedtext\r\n\r\n<pre><code>\r\n...\r\njimport('joomla.log.log');\r\nclass JLogLoggerFormattedtextVisforms extends JLogLoggerFormattedtext\r\n{\r\n\tprotected $priorities = array(\r\n\t\tJLog::EMERGENCY => 'EMG',\r\n\t\tJLog::ALERT => 'ALT',\r\n\t\tJLog::CRITICAL => 'CRI',\r\n\t\tJLog::ERROR => 'ERR',\r\n\t\tJLog::WARNING => 'WRN',\r\n\t\tJLog::NOTICE => 'NTC',\r\n\t\tJLog::INFO => 'INF',\r\n\t\tJLog::DEBUG => 'DBG'\r\n       );\r\n\t\r\n\tpublic function addEntry(JLogEntry $entry)\r\n\t{\r\n\t\ttry {\r\n\t\t    @parent::addEntry($entry);\r\n\t\t} catch (RuntimeException $e) {\r\n\t\t\t//prevent installation from being aborted as failed, if we cannot write the log file\r\n\t\t}\r\n\t}\r\n}\r\n\r\nclass com_visformsInstallerScript\r\n{\r\n\t...\r\n}\r\n</code></pre>\r\nInstalling the component on Joomla! 3.8.0 rc1 fails whereas the exact same installation works on Joomla! 3.7.5 properly without any problems\r\n\r\n### Steps to reproduce the issue\r\nVisforms is available from JED through \"Install from Web\", if you want to reproduce the problem.\r\nInstall on Joomla! 3.7.5 works without problems. (Message: Message \"Installation of the component was successful.\")\r\nInstall on Joomla! 3.8.0 rc1 throws the error message: \r\nUnable to create a Logger instance: Joomla\\CMS\\Log\\Logger\\FormattedtextvisformsLogger\r\n\r\n### Expected result\r\nOn Joomla! 3.8.0 rc1 although: Message \"Installation of the component was successful.\"\r\n\r\n\r\n### Actual result\r\nerror message: \r\nUnable to create a Logger instance: Joomla\\CMS\\Log\\Logger\\FormattedtextvisformsLogger\r\n\r\n\r\n### System information (as much as possible)\r\nphp 7.1.7 on local XAMPP 7.1.7\r\n\r\n\r\n### Additional comments\r\nI actually think I have extended the Joomla! Logger in the intended way and that the code posted above should still work with Joomla! 3.8.0, so this is a backward compatibility problem with the installer.\r\nI think after moving the Logger to the librairies/src folder with Joomla! 3.8.0 it is now necessary to use the proper namespace, which should be implemented by the Joomla! installer.\r\nPlease let me know, if I'm wrong.\r\n\r\nRegards,\r\nAicha\r\n"}}
{"actor":{"display_login":"avjoomla"}}