Class HttpAccessLogHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
io.micronaut.http.server.netty.handler.accesslog.HttpAccessLogHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler,io.netty.channel.ChannelOutboundHandler
@Sharable
public class HttpAccessLogHandler
extends io.netty.channel.ChannelDuplexHandler
Logging handler for HTTP access logs.
Access logs will be logged at info level.
- Since:
- 2.0
- Author:
- croudet
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHttpAccessLogHandler(String loggerName, String spec) Creates a HttpAccessLogHandler.HttpAccessLogHandler(String loggerName, String spec, Predicate<String> uriInclusion) Creates a HttpAccessLogHandler.HttpAccessLogHandler(org.slf4j.Logger logger, String spec) Creates a HttpAccessLogHandler.HttpAccessLogHandler(org.slf4j.Logger logger, String spec, Predicate<String> uriInclusion) Creates a HttpAccessLogHandler. -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg) voidwrite(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, readMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Field Details
-
HTTP_ACCESS_LOGGER
The default logger name.- See Also:
-
-
Constructor Details
-
HttpAccessLogHandler
Creates a HttpAccessLogHandler.- Parameters:
loggerName- A logger name.spec- The log format specification.
-
HttpAccessLogHandler
Creates a HttpAccessLogHandler.- Parameters:
loggerName- A logger name.spec- The log format specification.uriInclusion- A filtering Predicate that will be checked per URI.
-
HttpAccessLogHandler
Creates a HttpAccessLogHandler.- Parameters:
logger- A logger. Will log at info level.spec- The log format specification.
-
HttpAccessLogHandler
Creates a HttpAccessLogHandler.- Parameters:
logger- A logger. Will log at info level.spec- The log format specification.uriInclusion- A filtering Predicate that will be checked per URI.
-
-
Method Details
-
channelRead
public void channelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg) throws io.netty.handler.codec.http2.Http2Exception - Specified by:
channelReadin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelReadin classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
io.netty.handler.codec.http2.Http2Exception
-
write
public void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) throws Exception - Specified by:
writein interfaceio.netty.channel.ChannelOutboundHandler- Overrides:
writein classio.netty.channel.ChannelDuplexHandler- Throws:
Exception
-