Skip to content

Commit 4ced446

Browse files
skhotovelirobbavey
authored andcommitted
When log level is set to trace, format() was called before context was initiallized. Fixed
Fixes #319
1 parent 263de80 commit 4ced446

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/logstash/beats/BeatsHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ public BeatsHandler(IMessageListener listener) {
2121

2222
@Override
2323
public void channelActive(final ChannelHandlerContext ctx) throws Exception {
24+
context = ctx;
2425
if (logger.isTraceEnabled()){
2526
logger.trace(format("Channel Active"));
2627
}
2728
super.channelActive(ctx);
28-
context = ctx;
2929
messageListener.onNewConnection(ctx);
3030
}
3131

0 commit comments

Comments
 (0)