Exemplo n.º 1
0
 /**
  * Init class data
  */
 public static function init()
 {
     $defaultLogFile = OC_Config::getValue("datadirectory", OC::$SERVERROOT . '/data') . '/owncloud.log';
     self::$logFile = OC_Config::getValue("logfile", $defaultLogFile);
     if (!file_exists(self::$logFile)) {
         self::$logFile = $defaultLogFile;
     }
 }
Exemplo n.º 2
0
 /**
  * Init class data
  */
 public static function init()
 {
     $defaultLogFile = OC_Config::getValue("datadirectory", OC::$SERVERROOT . '/data') . '/owncloud.log';
     self::$logFile = OC_Config::getValue("logfile", $defaultLogFile);
     /*
      * Fall back to default log file if specified logfile does not exist
      * and can not be created. Error suppression is required in order to
      * not end up in the error handler which will try to log the error.
      * A better solution (compared to error suppression) would be checking
      * !is_writable(dirname(self::$logFile)) before touch(), but
      * is_writable() on directories used to be pretty unreliable on Windows
      * for at least some time.
      */
     if (!file_exists(self::$logFile) && !@touch(self::$logFile)) {
         self::$logFile = $defaultLogFile;
     }
 }
Exemplo n.º 3
0
 /**
  * Init class data
  */
 public static function init()
 {
     $systemConfig = \OC::$server->getSystemConfig();
     $defaultLogFile = $systemConfig->getValue("datadirectory", OC::$SERVERROOT . '/data') . '/owncloud.log';
     self::$logFile = $systemConfig->getValue("logfile", $defaultLogFile);
     /**
      * Fall back to default log file if specified logfile does not exist
      * and can not be created.
      */
     if (!file_exists(self::$logFile)) {
         if (!is_writable(dirname(self::$logFile))) {
             self::$logFile = $defaultLogFile;
         } else {
             if (!touch(self::$logFile)) {
                 self::$logFile = $defaultLogFile;
             }
         }
     }
 }
Exemplo n.º 4
0
 /**
  * Init class data
  */
 public static function init()
 {
     $datadir = OC_Config::getValue("datadirectory", OC::$SERVERROOT . '/data');
     self::$logFile = OC_Config::getValue("logfile", $datadir . '/owncloud.log');
 }