日志格式调整

This commit is contained in:
dongwei 2019-01-10 15:07:25 +08:00
parent c61443cb69
commit c60a1aa9e4

View File

@ -20,11 +20,7 @@ class ClientServiceProvider extends ServiceProvider
$this->app->configure('rpc'); $this->app->configure('rpc');
$config = config('rpc.client'); $config = config('rpc.client');
$dateFormat = "Y n j, g:i a";
$output = "%datetime% > %level_name% > %message% %context% %extra%\n";
$formatter = new LineFormatter($output, $dateFormat);
$stream = new StreamHandler($this->app->storagePath()."/logs/rpc_monitor_".date("Ymd").".log"); $stream = new StreamHandler($this->app->storagePath()."/logs/rpc_monitor_".date("Ymd").".log");
$stream->setFormatter($formatter);
$logger = new Logger('RPC.LOGGER'); $logger = new Logger('RPC.LOGGER');
$logger->pushHandler($stream); $logger->pushHandler($stream);
$this->app->singleton('rpc', function () use ($config, $logger) { $this->app->singleton('rpc', function () use ($config, $logger) {