request -id

This commit is contained in:
dongwei 2019-01-11 16:59:21 +08:00
parent d1b992a044
commit 1bcb8a010a
2 changed files with 2 additions and 8 deletions

View File

@ -31,8 +31,7 @@ class Client
$stream->setFormatter(new $this->config['log_formatter']());
$logger = new Logger('RPC.LOGGER');
$logger->pushHandler($stream);
$logger->info('call client rpc');
$this->id = 0;
$this->id = app('request')->header('X-Request-Id')?:"no-x-request-id";
$this->logger = $logger;
}
@ -114,8 +113,7 @@ class Client
*/
protected function id()
{
$this->id++;
return $this->id;
return $this->id.'-'.time();
}
}

View File

@ -31,8 +31,4 @@ class ClientServiceProvider extends ServiceProvider
}
}
// public function provides()
// {
// return ['rpc'];
// }
}