mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 09:22:33 +00:00
Do not overrule logging when it’s not set to daily.
This commit is contained in:
@@ -2,7 +2,7 @@ APP_ENV=local
|
|||||||
APP_DEBUG=true
|
APP_DEBUG=true
|
||||||
APP_NAME=FireflyIII
|
APP_NAME=FireflyIII
|
||||||
APP_KEY=7ahyYVPVsmxjdhsweWCauGeJfwc92NP2
|
APP_KEY=7ahyYVPVsmxjdhsweWCauGeJfwc92NP2
|
||||||
APP_LOG=syslog
|
APP_LOG=errorlog
|
||||||
APP_LOG_LEVEL=debug
|
APP_LOG_LEVEL=debug
|
||||||
APP_URL=http://localhost
|
APP_URL=http://localhost
|
||||||
TRUSTED_PROXIES=
|
TRUSTED_PROXIES=
|
||||||
|
@@ -21,7 +21,7 @@ bcscale(12);
|
|||||||
|
|
||||||
|
|
||||||
$app = new Illuminate\Foundation\Application(
|
$app = new Illuminate\Foundation\Application(
|
||||||
realpath(__DIR__.'/../')
|
realpath(__DIR__ . '/../')
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -51,33 +51,36 @@ $app->singleton(
|
|||||||
);
|
);
|
||||||
|
|
||||||
/* Overrule logging */
|
/* Overrule logging */
|
||||||
$app->configureMonologUsing(
|
if ($app->make('config')->get('app.log') === 'daily') {
|
||||||
function (Logger $monolog) use ($app) {
|
$app->configureMonologUsing(
|
||||||
$interface = php_sapi_name();
|
function (Logger $monolog) use ($app) {
|
||||||
$path = $app->storagePath() . '/logs/ff3-' . $interface . '.log';
|
|
||||||
$level = 'debug';
|
$interface = php_sapi_name();
|
||||||
if ($app->bound('config')) {
|
$path = $app->storagePath() . '/logs/ff3-' . $interface . '.log';
|
||||||
$level = $app->make('config')->get('app.log_level', 'debug');
|
$level = 'debug';
|
||||||
|
if ($app->bound('config')) {
|
||||||
|
$level = $app->make('config')->get('app.log_level', 'debug');
|
||||||
|
}
|
||||||
|
$levels = [
|
||||||
|
'debug' => Logger::DEBUG,
|
||||||
|
'info' => Logger::INFO,
|
||||||
|
'notice' => Logger::NOTICE,
|
||||||
|
'warning' => Logger::WARNING,
|
||||||
|
'error' => Logger::ERROR,
|
||||||
|
'critical' => Logger::CRITICAL,
|
||||||
|
'alert' => Logger::ALERT,
|
||||||
|
'emergency' => Logger::EMERGENCY,
|
||||||
|
];
|
||||||
|
|
||||||
|
$useLevel = $levels[$level];
|
||||||
|
|
||||||
|
$formatter = new LineFormatter(null, null, true, true);
|
||||||
|
$handler = new RotatingFileHandler($path, 5, $useLevel);
|
||||||
|
$handler->setFormatter($formatter);
|
||||||
|
$monolog->pushHandler($handler);
|
||||||
}
|
}
|
||||||
$levels = [
|
);
|
||||||
'debug' => Logger::DEBUG,
|
}
|
||||||
'info' => Logger::INFO,
|
|
||||||
'notice' => Logger::NOTICE,
|
|
||||||
'warning' => Logger::WARNING,
|
|
||||||
'error' => Logger::ERROR,
|
|
||||||
'critical' => Logger::CRITICAL,
|
|
||||||
'alert' => Logger::ALERT,
|
|
||||||
'emergency' => Logger::EMERGENCY,
|
|
||||||
];
|
|
||||||
|
|
||||||
$useLevel = $levels[$level];
|
|
||||||
|
|
||||||
$formatter = new LineFormatter(null, null, true, true);
|
|
||||||
$handler = new RotatingFileHandler($path, 5, $useLevel);
|
|
||||||
$handler->setFormatter($formatter);
|
|
||||||
$monolog->pushHandler($handler);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user