diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-12 03:35:33 -0700 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-12 03:35:33 -0700 |
commit | 8be9773c730aa51aa771e20cddced89baddf680d (patch) | |
tree | 27ff815afdfb5ecfb32e101bfe86bd12540b023c | |
parent | e6d034a60b89be0f24702974d9c9d383ee2b374d (diff) | |
parent | 14617682c8b0a833655be57f2be80ba2e78658d2 (diff) | |
download | nextcloud-server-8be9773c730aa51aa771e20cddced89baddf680d.tar.gz nextcloud-server-8be9773c730aa51aa771e20cddced89baddf680d.zip |
Merge pull request #5303 from owncloud/fix-unlogged-session-error
Log an error when session initialization fails before ownCloud is intalled
-rw-r--r-- | lib/base.php | 3 | ||||
-rw-r--r-- | lib/private/log/owncloud.php | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/base.php b/lib/base.php index ff4ca588213..9068fe76981 100644 --- a/lib/base.php +++ b/lib/base.php @@ -304,9 +304,8 @@ class OC { self::$session = new \OC\Session\Internal(OC_Util::getInstanceId()); // if session cant be started break with http 500 error } catch (Exception $e) { - OC_Log::write('core', 'Session could not be initialized', + OC_Log::write('core', 'Session could not be initialized. Exception message: '.$e->getMessage(), OC_Log::ERROR); - header('HTTP/1.1 500 Internal Server Error'); OC_Util::addStyle("styles"); $error = 'Session could not be initialized. Please contact your '; diff --git a/lib/private/log/owncloud.php b/lib/private/log/owncloud.php index f3b43584409..a408e3830d6 100644 --- a/lib/private/log/owncloud.php +++ b/lib/private/log/owncloud.php @@ -59,10 +59,14 @@ class OC_Log_Owncloud { } $time = new DateTime(null, $timezone); $entry=array('app'=>$app, 'message'=>$message, 'level'=>$level, 'time'=> $time->format($format)); + $entry = json_encode($entry); $handle = @fopen(self::$logFile, 'a'); if ($handle) { - fwrite($handle, json_encode($entry)."\n"); + fwrite($handle, $entry."\n"); fclose($handle); + } else { + // Fall back to error_log + error_log($entry); } } } |