Regress for logging
This commit is contained in:
parent
bfd71feac0
commit
0d6cc52d23
@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Log;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class LogServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
Log::channel('single')->popHandler();
|
||||
config(['logging.channels.single.path' => $this->getLogPath()]);
|
||||
|
||||
if (! config('app.debug')) {
|
||||
@unlink(storage_path('logs/laravel.log'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
protected static function getLogPath()
|
||||
{
|
||||
$mask = substr(md5(implode(',', array_values(get_db_config()))), 0, 16);
|
||||
|
||||
return storage_path("logs/bs-$mask.log");
|
||||
}
|
||||
}
|
@ -182,7 +182,6 @@ return [
|
||||
App\Providers\AppServiceProvider::class,
|
||||
App\Providers\PluginServiceProvider::class,
|
||||
App\Providers\EventServiceProvider::class,
|
||||
App\Providers\LogServiceProvider::class,
|
||||
App\Providers\MemoryServiceProvider::class,
|
||||
App\Providers\RouteServiceProvider::class,
|
||||
App\Providers\ResponseMacroServiceProvider::class,
|
||||
|
@ -13,7 +13,7 @@ return [
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('LOG_CHANNEL', 'single'),
|
||||
'default' => env('LOG_CHANNEL', 'stack'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user