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
-
Constructor Summary
ConstructorDescriptionHttpAccessLogHandler
(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 TypeMethodDescriptionvoid
channelRead
(io.netty.channel.ChannelHandlerContext ctx, Object msg) void
write
(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, read
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
channelRead
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelRead
in 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:
write
in interfaceio.netty.channel.ChannelOutboundHandler
- Overrides:
write
in classio.netty.channel.ChannelDuplexHandler
- Throws:
Exception
-