@ChannelHandler.Sharable public class GelfMessageJsonEncoder extends io.netty.handler.codec.MessageToMessageEncoder<GelfMessage>
GelfMessage into valid JSON according to the
GELF specification.| Constructor and Description |
|---|
GelfMessageJsonEncoder()
Creates a new instance of this channel handler with the default
JsonFactory. |
GelfMessageJsonEncoder(com.fasterxml.jackson.core.JsonFactory jsonFactory)
Creates a new instance of this channel handler with the given
JsonFactory. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
encode(io.netty.channel.ChannelHandlerContext ctx,
GelfMessage message,
List<Object> out) |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause) |
acceptOutboundMessage, writebind, close, connect, deregister, disconnect, flush, readensureNotSharable, handlerAdded, handlerRemoved, isSharablepublic GelfMessageJsonEncoder()
JsonFactory.public GelfMessageJsonEncoder(com.fasterxml.jackson.core.JsonFactory jsonFactory)
JsonFactory.jsonFactory - the Jackson JsonFactory to use for constructing a GELF message payloadpublic void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause)
throws Exception
exceptionCaught in interface io.netty.channel.ChannelHandlerexceptionCaught in class io.netty.channel.ChannelHandlerAdapterExceptionprotected void encode(io.netty.channel.ChannelHandlerContext ctx,
GelfMessage message,
List<Object> out)
throws Exception
encode in class io.netty.handler.codec.MessageToMessageEncoder<GelfMessage>ExceptionCopyright © 2014–2017 Graylog, Inc.. All rights reserved.