Do not overrule logging when it’s not set to daily.

This commit is contained in:
James Cole
2017-11-29 18:10:43 +01:00
parent 86d8ba6fc5
commit 16b0264a79
2 changed files with 31 additions and 28 deletions

View File

@@ -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=

View File

@@ -21,7 +21,7 @@ bcscale(12);
$app = new Illuminate\Foundation\Application( $app = new Illuminate\Foundation\Application(
realpath(__DIR__.'/../') realpath(__DIR__ . '/../')
); );
/* /*
@@ -51,8 +51,10 @@ $app->singleton(
); );
/* Overrule logging */ /* Overrule logging */
$app->configureMonologUsing( if ($app->make('config')->get('app.log') === 'daily') {
$app->configureMonologUsing(
function (Logger $monolog) use ($app) { function (Logger $monolog) use ($app) {
$interface = php_sapi_name(); $interface = php_sapi_name();
$path = $app->storagePath() . '/logs/ff3-' . $interface . '.log'; $path = $app->storagePath() . '/logs/ff3-' . $interface . '.log';
$level = 'debug'; $level = 'debug';
@@ -77,7 +79,8 @@ $app->configureMonologUsing(
$handler->setFormatter($formatter); $handler->setFormatter($formatter);
$monolog->pushHandler($handler); $monolog->pushHandler($handler);
} }
); );
}
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------