Index: .
===================================================================
--- .	(revision 21362)
+++ .	(working copy)
@@ -140,7 +140,7 @@
                                                               'style' => 'strict',
                                                               'xhtml-identifier' => 'ezdebug-first-strict',
                                                               'name' => 'Strict' ) );
-        $this->LogFiles = array( self::LEVEL_NOTICE => array( "var/log/",
+     /*   $this->LogFiles = array( self::LEVEL_NOTICE => array( "var/log/",
                                                            "notice.log" ),
                                  self::LEVEL_WARNING => array( "var/log/",
                                                             "warning.log" ),
@@ -149,7 +149,8 @@
                                  self::LEVEL_DEBUG => array( "var/log/",
                                                           "debug.log" ),
                                  self::LEVEL_STRICT => array( 'var/log/',
-                                                           'strict.log' ) );
+                                                           'strict.log' ) );*/
+        $this->setLogFiles( $varLogDir );
         $this->MessageTypes = array( self::LEVEL_NOTICE,
                                      self::LEVEL_WARNING,
                                      self::LEVEL_ERROR,
@@ -1130,6 +1131,8 @@
         }
 
         $GLOBALS['eZDebugEnabled'] = $debugEnabled;
+
+        eZDebug::updateLogFileDirForCurrentSiteaccess();
         eZDebug::setHandleType( $oldHandleType );
     }
 
@@ -1834,6 +1837,46 @@
         }
     }
 
+    /*!
+     Update the LogDir using siti.ini settings
+    */
+    static function updateLogFileDirForCurrentSiteaccess()
+    {
+        $ini = eZINI::instance();
+        $debug = eZDebug::instance();
+
+        $useGlobalLogDir = $ini->variable('FileSettings', 'UseGlobalLogDir' );
+        if( $useGlobalLogDir === 'disabled')
+        {
+            $varDir = $ini->variable('FileSettings', 'VarDir');
+            $logDir = $ini->variable('FileSettings', 'LogDir');
+            $varLogDir = "$varDir/$logDir/";
+            $debug->setLogFiles( $varLogDir );
+        }
+        else
+        {
+            // use default LogDir
+            $debug->setLogFiles();
+        }
+    }
+
+    /*!
+     Set the LogFiles
+    */
+    function setLogFiles( $logDir = 'var/log/' )
+    {
+        $this->LogFiles = array( self::LEVEL_NOTICE => array( $logDir,
+                                                           "notice.log" ),
+                                 self::LEVEL_WARNING => array( $logDir,
+                                                            "warning.log" ),
+                                 self::LEVEL_ERROR => array( $logDir,
+                                                          "error.log" ),
+                                 self::LEVEL_DEBUG => array( $logDir,
+                                                          "debug.log" ),
+                                 self::LEVEL_STRICT => array( $logDir,
+                                                           'strict.log' ) );
+    }
+
     /// \privatesection
     /// String array containing the debug information
     public $DebugStrings = array();
