From f926c00d15e3936abd86abdf17710a32bf19dae3 Mon Sep 17 00:00:00 2001 From: Nikita Koksharov Date: Wed, 18 Aug 2021 10:48:13 +0300 Subject: [PATCH] Connection logs improved --- .../org/redisson/command/RedisExecutor.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/redisson/src/main/java/org/redisson/command/RedisExecutor.java b/redisson/src/main/java/org/redisson/command/RedisExecutor.java index cbe91b66f..00713b331 100644 --- a/redisson/src/main/java/org/redisson/command/RedisExecutor.java +++ b/redisson/src/main/java/org/redisson/command/RedisExecutor.java @@ -499,8 +499,12 @@ public class RedisExecutor { writeFuture = connection.send(new CommandsData(main, list, false, false)); } else { if (log.isDebugEnabled()) { - log.debug("acquired connection for command {} and params {} from slot {} using node {}... {}", - command, LogHelper.toString(params), source, connection.getRedisClient().getAddr(), connection); + String connectionType = " "; + if (connection instanceof RedisPubSubConnection) { + connectionType = " pubsub "; + } + log.debug("acquired{}connection for command {} and params {} from slot {} using node {}... {}", + connectionType, command, LogHelper.toString(params), source, connection.getRedisClient().getAddr(), connection); } writeFuture = connection.send(new CommandData<>(attemptPromise, codec, command, params)); } @@ -521,8 +525,13 @@ public class RedisExecutor { } if (log.isDebugEnabled()) { - log.debug("connection released for command {} and params {} from slot {} using connection {}", - command, LogHelper.toString(params), source, connection); + String connectionType = " "; + if (connection instanceof RedisPubSubConnection) { + connectionType = " pubsub "; + } + + log.debug("connection{}released for command {} and params {} from slot {} using connection {}", + connectionType, command, LogHelper.toString(params), source, connection); } }