Published: April 30, 2019
Last updated:

Magento logging not working in 1.9.4.1 or after SUPEE-11086

After upgrade to Magento 1.9.4.1 or SUPEE-11086 Magento logging not working if log file does not exist.

Cause

In 1.9.4.1 (and SUPEE-11086) Magento added log validation function to validate extensions and it throws error on is_readable() function in case log file does not exist yet.

Solution

Use MPERF-10565 patch below to correct this issue.

Note: This patch will be included in the next official SUPEE-release and should be reverted priot to next SUPEE-patch installation.
--- app/Mage.php
+++ app/Mage.php
@@ -798,9 +798,9 @@ public static function log($message, $level = null, $file = '', $forceLog = fals
             ',',
             (string) self::getConfig()->getNode('dev/log/allowedFileExtensions', Mage_Core_Model_Store::DEFAULT_CODE)
         );
-        $logValidator = new Zend_Validate_File_Extension($_allowedFileExtensions);
         $logDir = self::getBaseDir('var') . DS . 'log';
-        if (!$logValidator->isValid($logDir . DS . $file)) {
+        $validatedFileExtension = pathinfo($file, PATHINFO_EXTENSION);
+        if (!$validatedFileExtension || !in_array($validatedFileExtension, $_allowedFileExtensions)) {
             return;
         }



If you have any difficulties with solving this problem or got a similar one, please let us know in comments below, so we can find the solution together.

Posted in: Magento Maintenance, supee-11086

34 votes, 4.53 avg. rating (89% score)