Like others, I had log files completely stop writing data.
Source of the Bug - Log Files Not Writing Data
In app/Mage.php
they made this change:
// Validate file extension before save. Allowed file extensions: log, txt, html, csv
- if (!self::helper('log')->isLogFileExtensionValid($file)) {
+ $_allowedFileExtensions = explode(
+ ',',
+ (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)) {
return;
}
which is looking to the config for a comma separated list of approved file extensions. They did NOT add this list in the config however - not even an option in the Mage Admin for us to configure this on our own.
Solution to the Bug - Log Files Not Writing Data
To solve this, simply make an entry into the database in the core_config_data
table.
INSERT INTO core_config_data VALUES ( NULL, 'default', 0, 'dev/log/allowedFileExtensions', 'log,txt,html,csv' );
Clear the objects cache as well and you should see data writing to the log files once again.
ls -lrt var/log/ | tail
For reference, this issue was on EE 1.14.2.0 with all security patches applied.
I did open a ticket with Magento Support on this issue but have not received a response from a technician yet. I'm in the queue.
What really confuses me about this bug is that Magento already has a method for validating log file extensions that they added via SUPEE-10415 in late 2017.
app/code/core/Mage/Log/Helper/Data.php
/**
* Checking if file extensions is allowed. If passed then return true.
*
* @param $file
* @return bool
*/
public function isLogFileExtensionValid($file)
{
$result = false;
$validatedFileExtension = pathinfo($file, PATHINFO_EXTENSION);
if ($validatedFileExtension && in_array($validatedFileExtension, $this->_allowedFileExtensions)) {
$result = true;
}
return $result;
}
Why didn't they reuse that logic instead of attempting an incomplete re-invention the log wheel?