Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added support for logging to php://output

  • Loading branch information...
commit e0a4fd55c1c04d6e99506210c053cef6474738ab 1 parent aa5be36
authored July 18, 2012

Showing 1 changed file with 15 additions and 11 deletions. Show diff stats Hide diff stats

  1. 26  app/Mage.php
26  app/Mage.php
@@ -768,17 +768,21 @@ public static function log($message, $level = null, $file = '', $forceLog = fals
768 768
 
769 769
         try {
770 770
             if (!isset($loggers[$file])) {
771  
-                $logDir  = self::getBaseDir('var') . DS . 'log';
772  
-                $logFile = $logDir . DS . $file;
773  
-
774  
-                if (!is_dir($logDir)) {
775  
-                    mkdir($logDir);
776  
-                    chmod($logDir, 0777);
777  
-                }
778  
-
779  
-                if (!file_exists($logFile)) {
780  
-                    file_put_contents($logFile, '');
781  
-                    chmod($logFile, 0777);
  771
+                if (substr($file,0,6) == 'php://') {
  772
+                    $logFile = $file;
  773
+                }  else {
  774
+                    $logDir  = self::getBaseDir('var') . DS . 'log';
  775
+                    $logFile = $logDir . DS . $file;
  776
+
  777
+                    if (!is_dir($logDir)) {
  778
+                        mkdir($logDir);
  779
+                        chmod($logDir, 0777);
  780
+                    }
  781
+
  782
+                    if (!file_exists($logFile)) {
  783
+                        file_put_contents($logFile, '');
  784
+                        chmod($logFile, 0777);
  785
+                    }
782 786
                 }
783 787
 
784 788
                 $format = '%timestamp% %priorityName% (%priority%): %message%' . PHP_EOL;

0 notes on commit e0a4fd5

Please sign in to comment.
Something went wrong with that request. Please try again.