mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-30 10:33:30 +00:00
Some log fine tuning.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
APP_ENV=production
|
APP_ENV=production
|
||||||
APP_DEBUG=false
|
APP_DEBUG=false
|
||||||
APP_KEY=SomeRandomStringOf32CharsExactly
|
APP_KEY=SomeRandomStringOf32CharsExactly
|
||||||
|
LOG_LEVEL=warning
|
||||||
|
|
||||||
DB_CONNECTION=mysql
|
DB_CONNECTION=mysql
|
||||||
DB_HOST=localhost
|
DB_HOST=localhost
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
APP_ENV=testing
|
APP_ENV=testing
|
||||||
APP_DEBUG=true
|
APP_DEBUG=true
|
||||||
APP_KEY=SomeRandomStringOf32CharsExactly
|
APP_KEY=SomeRandomStringOf32CharsExactly
|
||||||
|
LOG_LEVEL=debug
|
||||||
|
|
||||||
DB_CONNECTION=sqlite
|
DB_CONNECTION=sqlite
|
||||||
DB_HOST=localhost
|
DB_HOST=localhost
|
||||||
|
43
app/Bootstrap/ConfigureLogging.php
Normal file
43
app/Bootstrap/ConfigureLogging.php
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* ConfigureLogging.php
|
||||||
|
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
||||||
|
*
|
||||||
|
* This software may be modified and distributed under the terms
|
||||||
|
* of the MIT license. See the LICENSE file for details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace FireflyIII\Bootstrap;
|
||||||
|
|
||||||
|
use Illuminate\Log\Writer;
|
||||||
|
use Illuminate\Contracts\Foundation\Application;
|
||||||
|
use Illuminate\Foundation\Bootstrap\ConfigureLogging as IlluminateConfigureLogging;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class ConfigureLogging
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Bootstrap
|
||||||
|
*/
|
||||||
|
class ConfigureLogging extends IlluminateConfigureLogging
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param Application $app
|
||||||
|
* @param Writer $log
|
||||||
|
*/
|
||||||
|
protected function configureSingleHandler(Application $app, Writer $log)
|
||||||
|
{
|
||||||
|
$log->useFiles($app->storagePath().'/logs/firefly-iii.log');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Application $app
|
||||||
|
* @param Writer $log
|
||||||
|
*/
|
||||||
|
protected function configureDailyHandler(Application $app, Writer $log)
|
||||||
|
{
|
||||||
|
$log->useDailyFiles(
|
||||||
|
$app->storagePath().'/logs/firefly-iii.log',
|
||||||
|
$app->make('config')->get('app.log_max_files', 5)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@@ -22,6 +22,25 @@ use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
|||||||
*/
|
*/
|
||||||
class Kernel extends ConsoleKernel
|
class Kernel extends ConsoleKernel
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The bootstrap classes for the application.
|
||||||
|
*
|
||||||
|
* This needs to be for with the next upgrade.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $bootstrappers = [
|
||||||
|
'Illuminate\Foundation\Bootstrap\DetectEnvironment',
|
||||||
|
'Illuminate\Foundation\Bootstrap\LoadConfiguration',
|
||||||
|
'FireflyIII\Bootstrap\ConfigureLogging',
|
||||||
|
'Illuminate\Foundation\Bootstrap\HandleExceptions',
|
||||||
|
'Illuminate\Foundation\Bootstrap\RegisterFacades',
|
||||||
|
'Illuminate\Foundation\Bootstrap\SetRequestForConsole',
|
||||||
|
'Illuminate\Foundation\Bootstrap\RegisterProviders',
|
||||||
|
'Illuminate\Foundation\Bootstrap\BootProviders',
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Artisan commands provided by your application.
|
* The Artisan commands provided by your application.
|
||||||
*
|
*
|
||||||
|
@@ -29,6 +29,23 @@ use Illuminate\View\Middleware\ShareErrorsFromSession;
|
|||||||
*/
|
*/
|
||||||
class Kernel extends HttpKernel
|
class Kernel extends HttpKernel
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* The bootstrap classes for the application.
|
||||||
|
*
|
||||||
|
* Next upgrade should verify these are all here.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $bootstrappers = [
|
||||||
|
'Illuminate\Foundation\Bootstrap\DetectEnvironment',
|
||||||
|
'Illuminate\Foundation\Bootstrap\LoadConfiguration',
|
||||||
|
'FireflyIII\Bootstrap\ConfigureLogging',
|
||||||
|
'Illuminate\Foundation\Bootstrap\HandleExceptions',
|
||||||
|
'Illuminate\Foundation\Bootstrap\RegisterFacades',
|
||||||
|
'Illuminate\Foundation\Bootstrap\RegisterProviders',
|
||||||
|
'Illuminate\Foundation\Bootstrap\BootProviders',
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The application's global HTTP middleware stack.
|
* The application's global HTTP middleware stack.
|
||||||
*
|
*
|
||||||
|
@@ -38,7 +38,6 @@ class MailError extends Job implements ShouldQueue
|
|||||||
* @param string $ipAddress
|
* @param string $ipAddress
|
||||||
* @param array $exceptionData
|
* @param array $exceptionData
|
||||||
*
|
*
|
||||||
* @internal param array $exception
|
|
||||||
*/
|
*/
|
||||||
public function __construct(User $user, string $destination, string $ipAddress, array $exceptionData)
|
public function __construct(User $user, string $destination, string $ipAddress, array $exceptionData)
|
||||||
{
|
{
|
||||||
|
@@ -4,7 +4,8 @@ declare(strict_types = 1);
|
|||||||
namespace FireflyIII\Providers;
|
namespace FireflyIII\Providers;
|
||||||
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Log;
|
||||||
|
use Config;
|
||||||
/**
|
/**
|
||||||
* Class AppServiceProvider
|
* Class AppServiceProvider
|
||||||
*
|
*
|
||||||
@@ -29,6 +30,10 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
*/
|
*/
|
||||||
public function register()
|
public function register()
|
||||||
{
|
{
|
||||||
//
|
// make sure the logger doesn't log everything when it doesn't need to.
|
||||||
|
$monolog = Log::getMonolog();
|
||||||
|
foreach ($monolog->getHandlers() as $handler) {
|
||||||
|
$handler->setLevel(Config::get('app.log-level'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -109,6 +109,7 @@ return [
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
'log' => env('APP_LOG', 'daily'),
|
'log' => env('APP_LOG', 'daily'),
|
||||||
|
'log-level' => env('LOG_LEVEL', 'info'),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user