Skip to content

Commit 95be7da

Browse files
committed
redis exception log
1 parent 6174285 commit 95be7da

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

src/Very/Cache/Redis.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,12 @@ public function __call($func, $params)
111111
$redis_server = $this->connect($reconnect);
112112
$ret = call_user_func_array([$redis_server, $func], $params);
113113
} catch (\RedisException $e) {
114-
logger()->error('Redis exec error',
115-
[
116-
"host" => "{$this->config['host']}:{$this->config['port']}",
117-
"msg" => $e->getMessage(),
118-
"file" => $e->getFile(),
119-
'line' => $e->getLine(),
120-
]);
114+
logger()->error('Redis exec error', [
115+
"host" => "{$this->config['host']}:{$this->config['port']}",
116+
"msg" => $e->getMessage(),
117+
"method" => $func,
118+
"params" => $params,
119+
]);
121120
if ($i == 0) {
122121
$reconnect = true;
123122
continue;
@@ -127,6 +126,12 @@ public function __call($func, $params)
127126
}
128127
}
129128
} catch (\Exception $e) {
129+
logger()->error("Redis error", [
130+
"host" => "{$this->config['host']}:{$this->config['port']}",
131+
"method" => $func,
132+
"params" => $params,
133+
]);
134+
130135
if ($this->throw_exception) {
131136
throw $e;
132137
}

0 commit comments

Comments
 (0)