Verbose log enhancement: print client info when client exit (#9053)

It could be useful for debugging to know which client got disconnected.
This commit is contained in:
Yang Bodong 2021-06-08 17:39:27 +08:00 committed by GitHub
parent e16d3eb998
commit 119121c739
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -2166,7 +2166,11 @@ void readQueryFromClient(connection *conn) {
return;
}
} else if (nread == 0) {
serverLog(LL_VERBOSE, "Client closed connection");
if (server.verbosity <= LL_VERBOSE) {
sds info = catClientInfoString(sdsempty(), c);
serverLog(LL_VERBOSE, "Client closed connection %s", info);
sdsfree(info);
}
freeClientAsync(c);
return;
} else if (c->flags & CLIENT_MASTER) {