Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added support for logging to php://output

  • Loading branch information...
commit 476a0b30d1a6087f91551b6636b964b3e240de72 1 parent 3330e25
Alexander Menk authored
Showing with 15 additions and 11 deletions.
  1. +15 −11 app/Mage.php
View
26 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;
Please sign in to comment.
Something went wrong with that request. Please try again.