aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/handler/StandardLoggingHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/handler/StandardLoggingHandler.java')
-rw-r--r--src/main/java/org/traccar/handler/StandardLoggingHandler.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/handler/StandardLoggingHandler.java b/src/main/java/org/traccar/handler/StandardLoggingHandler.java
index 88010458f..13c5f8281 100644
--- a/src/main/java/org/traccar/handler/StandardLoggingHandler.java
+++ b/src/main/java/org/traccar/handler/StandardLoggingHandler.java
@@ -31,6 +31,12 @@ public class StandardLoggingHandler extends ChannelDuplexHandler {
private static final Logger LOGGER = LoggerFactory.getLogger(StandardLoggingHandler.class);
+ private final String protocol;
+
+ public StandardLoggingHandler(String protocol) {
+ this.protocol = protocol;
+ }
+
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
log(ctx, false, msg);
@@ -58,7 +64,7 @@ public class StandardLoggingHandler extends ChannelDuplexHandler {
StringBuilder message = new StringBuilder();
message.append("[").append(ctx.channel().id().asShortText()).append(": ");
- message.append(((InetSocketAddress) ctx.channel().localAddress()).getPort());
+ message.append(protocol);
if (downstream) {
message.append(" > ");
} else {