forked from apache/mina-sshd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SSHD-1230] Log netty channel traffic on TRACE level
- Loading branch information
Showing
2 changed files
with
8 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,9 @@ | |
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a> | ||
*/ | ||
public class NettyIoAcceptor extends NettyIoService implements IoAcceptor { | ||
// Shared across all acceptors | ||
private static final LoggingHandler LOGGING_TRACE = new LoggingHandler(NettyIoAcceptor.class, LogLevel.TRACE); | ||
|
||
protected final ServerBootstrap bootstrap = new ServerBootstrap(); | ||
protected final Map<SocketAddress, Channel> boundAddresses = new ConcurrentHashMap<>(); | ||
|
||
|
@@ -66,7 +69,7 @@ public NettyIoAcceptor(NettyIoServiceFactory factory, IoHandler handler) { | |
bootstrap.group(factory.eventLoopGroup) | ||
.channel(NioServerSocketChannel.class) | ||
.option(ChannelOption.SO_BACKLOG, 100) // TODO make this configurable | ||
.handler(new LoggingHandler(LogLevel.INFO)) // TODO make this configurable | ||
.handler(LOGGING_TRACE) // TODO make this configurable | ||
.childHandler(new ChannelInitializer<SocketChannel>() { | ||
@Override | ||
@SuppressWarnings("synthetic-access") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,9 @@ | |
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a> | ||
*/ | ||
public class NettyIoConnector extends NettyIoService implements IoConnector { | ||
// Shared across all connectors | ||
private static final LoggingHandler LOGGING_TRACE = new LoggingHandler(NettyIoConnector.class, LogLevel.TRACE); | ||
|
||
protected final Bootstrap bootstrap = new Bootstrap(); | ||
|
||
public NettyIoConnector(NettyIoServiceFactory factory, IoHandler handler) { | ||
|
@@ -83,7 +86,7 @@ protected void initChannel(SocketChannel ch) throws Exception { | |
} | ||
|
||
ChannelPipeline p = ch.pipeline(); | ||
p.addLast(new LoggingHandler(LogLevel.INFO)); // TODO make this configurable | ||
p.addLast(LOGGING_TRACE); // TODO make this configurable | ||
p.addLast(session.adapter); | ||
} catch (Exception e) { | ||
if (listener != null) { | ||
|