diff --git a/app/Mage.php b/app/Mage.php index 3c97bd4894f73..572f7165bf667 100644 --- a/app/Mage.php +++ b/app/Mage.php @@ -768,17 +768,21 @@ public static function log($message, $level = null, $file = '', $forceLog = fals try { if (!isset($loggers[$file])) { - $logDir = self::getBaseDir('var') . DS . 'log'; - $logFile = $logDir . DS . $file; - - if (!is_dir($logDir)) { - mkdir($logDir); - chmod($logDir, 0777); - } - - if (!file_exists($logFile)) { - file_put_contents($logFile, ''); - chmod($logFile, 0777); + if (substr($file,0,6) == 'php://') { + $logFile = $file; + } else { + $logDir = self::getBaseDir('var') . DS . 'log'; + $logFile = $logDir . DS . $file; + + if (!is_dir($logDir)) { + mkdir($logDir); + chmod($logDir, 0777); + } + + if (!file_exists($logFile)) { + file_put_contents($logFile, ''); + chmod($logFile, 0777); + } } $format = '%timestamp% %priorityName% (%priority%): %message%' . PHP_EOL;