Class NettyHttpServerConfiguration.AccessLogger
- java.lang.Object
-
- io.micronaut.http.server.netty.configuration.NettyHttpServerConfiguration.AccessLogger
-
- Enclosing class:
- NettyHttpServerConfiguration
@ConfigurationProperties("access-logger") public static class NettyHttpServerConfiguration.AccessLogger extends java.lang.ObjectAccess logger configuration.
-
-
Constructor Summary
Constructors Constructor Description AccessLogger()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>getExclusions()java.lang.StringgetLogFormat()Returns the log format to use.java.lang.StringgetLoggerName()The logger name to use.booleanisEnabled()Returns whether the access logger is enabled.voidsetEnabled(boolean enabled)Enables or Disables the access logger.voidsetExclusions(java.util.List<java.lang.String> exclusions)Sets the URI patterns to be excluded from the access log.voidsetLogFormat(java.lang.String logFormat)Sets the log format to use.voidsetLoggerName(java.lang.String loggerName)Sets the logger name to use.
-
-
-
Method Detail
-
isEnabled
public boolean isEnabled()
Returns whether the access logger is enabled.- Returns:
- Whether the access logger is enabled.
-
setEnabled
public void setEnabled(boolean enabled)
Enables or Disables the access logger.- Parameters:
enabled- The flag.
-
getLoggerName
public java.lang.String getLoggerName()
The logger name to use. Access logs will be logged at info level.- Returns:
- The logger name.
-
setLoggerName
public void setLoggerName(java.lang.String loggerName)
Sets the logger name to use. If not specified 'HTTP_ACCESS_LOGGER' will be used.- Parameters:
loggerName- A logger name,
-
getLogFormat
public java.lang.String getLogFormat()
Returns the log format to use.- Returns:
- The log format.
-
setLogFormat
public void setLogFormat(java.lang.String logFormat)
Sets the log format to use. When not specified, the Common Log Format (CLF) will be used.- Parameters:
logFormat- The log format.
-
getExclusions
public java.util.List<java.lang.String> getExclusions()
- Returns:
- The URI patterns to exclude from the access log.
-
setExclusions
public void setExclusions(java.util.List<java.lang.String> exclusions)
Sets the URI patterns to be excluded from the access log.- Parameters:
exclusions- A list of regular expression patterns to be excluded from the access logger if the request URI matches.- See Also:
Pattern.compile(String)
-
-