|
|
@ -164,16 +164,14 @@ Class Controller { |
|
|
|
|
|
|
|
|
|
|
|
//error log |
|
|
|
//error log |
|
|
|
protected function logError($error_message) { |
|
|
|
protected function logError($error_message) { |
|
|
|
if (!empty(FSC::$app['config']['debug'])) { |
|
|
|
$thisUrl = FSC::$app['requestUrl']; |
|
|
|
$thisUrl = FSC::$app['requestUrl']; |
|
|
|
$logTime = date('Y-m-d H:i:s'); |
|
|
|
$logTime = date('Y-m-d H:i:s'); |
|
|
|
$logDir = __DIR__ . '/../runtime/logs/'; |
|
|
|
$logDir = __DIR__ . '/../runtime/logs/'; |
|
|
|
$logFilename = 'error.log'; |
|
|
|
$logFilename = 'error.log'; |
|
|
|
$logOk = @error_log("{$logTime}\t{$thisUrl}\tERROR: {$error_message}\n", 3, "{$logDir}{$logFilename}"); |
|
|
|
$logOk = @error_log("{$logTime}\t{$thisUrl}\tERROR: {$error_message}\n", 3, "{$logDir}{$logFilename}"); |
|
|
|
if (!$logOk) { //try to mkdir |
|
|
|
if (!$logOk) { //try to mkdir |
|
|
|
@mkdir($logDir, 0700, true); |
|
|
|
@mkdir($logDir, 0700, true); |
|
|
|
@error_log("{$logTime}\t{$thisUrl}\tERROR: {$error_message}\n", 3, "{$logDir}{$logFilename}"); |
|
|
|
@error_log("{$logTime}\t{$thisUrl}\tERROR: {$error_message}\n", 3, "{$logDir}{$logFilename}"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|