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(@Nullable String loggerName, @Nullable String spec) Creates a HttpAccessLogHandler.HttpAccessLogHandler(@Nullable String loggerName, @Nullable String spec, @Nullable Predicate<String> uriInclusion) Creates a HttpAccessLogHandler.HttpAccessLogHandler(@Nullable org.slf4j.Logger logger, @Nullable String spec) Creates a HttpAccessLogHandler.HttpAccessLogHandler(@Nullable org.slf4j.Logger logger, @Nullable String spec, @Nullable 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 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
-
-
Constructor Details
-
HttpAccessLogHandler
-
HttpAccessLogHandler
-
HttpAccessLogHandler
Creates a HttpAccessLogHandler.- Parameters:
logger- A logger. Will log at info level.spec- The log format specification.
-
HttpAccessLogHandler
public HttpAccessLogHandler(@Nullable org.slf4j.Logger logger, @Nullable String spec, @Nullable Predicate<String> uriInclusion) 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
-