mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
Cleaning up log files
This commit is contained in:
parent
5c1e9900d3
commit
b0a4a9b31c
@ -642,6 +642,6 @@ class PaymentController extends BaseController
|
||||
$message .= $error ?: trans('texts.payment_error');
|
||||
|
||||
Session::flash('error', $message);
|
||||
Utils::logError("Payment Error [{$type}]: " . ($exception ? Utils::getErrorString($exception) : $message));
|
||||
Utils::logError("Payment Error [{$type}]: " . ($exception ? Utils::getErrorString($exception) : $message), 'PHP', true);
|
||||
}
|
||||
}
|
||||
|
@ -247,7 +247,7 @@ class Utils
|
||||
return "***{$class}*** [{$code}] : {$exception->getFile()} [Line {$exception->getLine()}] => {$exception->getMessage()}";
|
||||
}
|
||||
|
||||
public static function logError($error, $context = 'PHP')
|
||||
public static function logError($error, $context = 'PHP', $info = false)
|
||||
{
|
||||
if ($error instanceof Exception) {
|
||||
$error = self::getErrorString($error);
|
||||
@ -271,7 +271,11 @@ class Utils
|
||||
'count' => Session::get('error_count', 0),
|
||||
];
|
||||
|
||||
Log::error($error."\n", $data);
|
||||
if ($info) {
|
||||
Log::info($error."\n", $data);
|
||||
} else {
|
||||
Log::error($error."\n", $data);
|
||||
}
|
||||
|
||||
/*
|
||||
Mail::queue('emails.error', ['message'=>$error.' '.json_encode($data)], function($message)
|
||||
|
@ -81,7 +81,7 @@ class Mailer
|
||||
$emailError = $exception->getMessage();
|
||||
}
|
||||
|
||||
Utils::logError("Email Error: $emailError");
|
||||
//Utils::logError("Email Error: $emailError");
|
||||
|
||||
if (isset($data['invitation'])) {
|
||||
$invitation = $data['invitation'];
|
||||
|
@ -58,4 +58,9 @@ if (strstr($_SERVER['HTTP_USER_AGENT'], 'PhantomJS') && Utils::isNinjaDev()) {
|
||||
}
|
||||
*/
|
||||
|
||||
// Write info messages to a separate file
|
||||
$app->configureMonologUsing(function($monolog) {
|
||||
$monolog->pushHandler(new Monolog\Handler\StreamHandler(storage_path() . '/logs/laravel-info.log', Monolog\Logger::INFO, false));
|
||||
});
|
||||
|
||||
return $app;
|
||||
|
Loading…
Reference in New Issue
Block a user