Skip to content

Commit

Permalink
enhancement reactor#434 Access Logs contents enhancement
Browse files Browse the repository at this point in the history
Add request port to the log message.
Add duration in milliseconds between request and response.
  • Loading branch information
Erwan Letessier committed Sep 17, 2018
1 parent 7067233 commit 59c5b1d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/reactor/netty/http/server/AccessLogHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception

accessLog = new AccessLog()
.address(((SocketChannel) ctx.channel()).remoteAddress().getHostString())
.port(((SocketChannel) ctx.channel()).localAddress().getPort())
.port(((SocketChannel) ctx.channel()).localAddress().getPort())
.method(request.method().name())
.uri(request.uri())
.protocol(request.protocolVersion().text());
Expand Down Expand Up @@ -122,10 +122,10 @@ AccessLog address(String address) {
return this;
}

AccessLog port(int port) {
this.port = port;
return this;
}
AccessLog port(int port) {
this.port = port;
return this;
}

AccessLog method(String method) {
this.method = Objects.requireNonNull(method, "method");
Expand Down

0 comments on commit 59c5b1d

Please sign in to comment.