add header

This commit is contained in:
dongwei 2019-01-19 17:17:54 +08:00
parent d5470ca40d
commit 8909b516ad
2 changed files with 2 additions and 4 deletions

View File

@ -95,9 +95,7 @@ class Client
try {
$headers = [
'client_app' => $this->config['app'],
'client_host' => gethostname(),
'client_addr' => $_SERVER['SERVER_ADDR'],
'x-client-app' => $this->config['app'],
];
app('rpc.logger')->info("client_request",array_merge($this->server_config, $payload));
$resp = $this->http->request('POST', 'rpc/json-rpc-v2.json', [

View File

@ -63,7 +63,7 @@ class JsonRpcServer
return $this->error(self::Rpc_Error_Invalid_Params);
}
app('rpc.logger')->info('server', [$id, $class,$method, $params, $this->request->header('client_app'), $this->request->header('client_addr'), $this->request->header('client_host')]);
app('rpc.logger')->info('server', [$id, $class,$method, $params, $this->request->header('x-client-app')]);
$ret = call_user_func_array([(new $class($id, $this->request)), $function], $params);
app('rpc.logger')->info('server_result', [$id, $ret]);