Class CallLogger.Builder
- Enclosing class:
CallLogger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Instantiates a new call logger based on the settings in this builder.debugRules
(CallLoggerRule... values) Adds logging rules to use when debug mode is enabled.disabled()
Shortcut for callingenabled( .NEVER )enabled
(Enablement value) Specifies the default logging enablement setting.enabledTest
(Predicate<jakarta.servlet.http.HttpServletRequest> value) Specifies the default logging enablement test predicate.The default logging level to use for logging the request/response.Specifies the logger to use for logging the request.Specifies the logger to use for logging the request.loggerOnce
(Logger value) Same aslogger(Logger)
but only sets the value if it's currentlynull .normalRules
(CallLoggerRule... values) Adds logging rules to use when debug mode is not enabled.requestDetail
(CallLoggingDetail value) The default level of detail to log on a request.responseDetail
(CallLoggingDetail value) The default level of detail to log on a response.rules
(CallLoggerRule... values) Shortcut for adding the same rules as normal and debug rules.thrownStore
(ThrownStore value) Specifies the thrown exception store to use for getting stack trace information (hash IDs and occurrence counts).thrownStoreOnce
(ThrownStore value) Same asthrownStore(ThrownStore)
but only sets the value if it's currentlynull .
-
Constructor Details
-
Builder
Constructor.- Parameters:
beanStore
- The bean store to use for creating beans.
-
-
Method Details
-
logger
Specifies the logger to use for logging the request.If not specified, the logger name is determined in the following order:
"juneau.restLogger.logger"
system property."JUNEAU_RESTLOGGER_LOGGER"
environment variable."global" .
The
CallLogger.getLogger()
method can also be overridden to provide different logic.- Parameters:
value
- The logger to use for logging the request.- Returns:
- This object.
-
logger
Specifies the logger to use for logging the request.Shortcut for calling
logger(Logger. .getLogger (value))If not specified, the logger name is determined in the following order:
"juneau.restLogger.logger"
system property."JUNEAU_RESTLOGGER_LOGGER"
environment variable."global" .
The
CallLogger.getLogger()
method can also be overridden to provide different logic.- Parameters:
value
- The logger to use for logging the request.- Returns:
- This object.
-
loggerOnce
Same aslogger(Logger)
but only sets the value if it's currentlynull .- Parameters:
value
- The logger to use for logging the request.- Returns:
- This object.
-
thrownStore
Specifies the thrown exception store to use for getting stack trace information (hash IDs and occurrence counts).- Parameters:
value
- The stack trace store.
Ifnull , stack trace information will not be logged.- Returns:
- This object.
-
thrownStoreOnce
Same asthrownStore(ThrownStore)
but only sets the value if it's currentlynull .- Parameters:
value
- The stack trace store.
Ifnull , stack trace information will not be logged.- Returns:
- This object.
-
enabled
Specifies the default logging enablement setting.This specifies the default logging enablement value if not set on the first matched rule or if no rules match.
If not specified, the setting is determined via the following:
"juneau.restLogger.enabled"
system property."JUNEAU_RESTLOGGER_ENABLED"
environment variable."ALWAYS" .
ALWAYS
(default) - Logging is enabled.NEVER
- Logging is disabled.CONDITIONALLY
- Logging is enabled if it passes theenabledTest(Predicate)
test.
- Parameters:
value
- The default enablement flag value. Can benull to use the default.- Returns:
- This object.
-
enabledTest
Specifies the default logging enablement test predicate.This specifies the default logging enablement test if not set on the first matched rule or if no rules match.
This setting has no effect if the enablement setting is not
CONDITIONALLY
.The default if not specified is
(never log).x ->false - Parameters:
value
- The default enablement flag value. Can benull to use the default.- Returns:
- This object.
-
disabled
Shortcut for callingenabled( .NEVER )- Returns:
- This object.
-
requestDetail
The default level of detail to log on a request.This specifies the default level of request detail if not set on the first matched rule or if no rules match.
If not specified, the setting is determined via the following:
"juneau.restLogger.requestDetail"
system property."JUNEAU_RESTLOGGER_requestDetail"
environment variable."STATUS_LINE" .
STATUS_LINE
- Log only the status line.HEADER
- Log the status line and headers.ENTITY
- Log the status line and headers and content if available.
- Parameters:
value
- The new value for this property, ornull to use the default.- Returns:
- This object.
-
responseDetail
The default level of detail to log on a response.This specifies the default level of response detail if not set on the first matched rule or if no rules match.
If not specified, the setting is determined via the following:
"juneau.restLogger.responseDetail"
system property."JUNEAU_RESTLOGGER_responseDetail"
environment variable."STATUS_LINE" .
STATUS_LINE
- Log only the status line.HEADER
- Log the status line and headers.ENTITY
- Log the status line and headers and content if available.
- Parameters:
value
- The new value for this property, ornull to use the default.- Returns:
- This object.
-
level
The default logging level to use for logging the request/response.This specifies the default logging level if not set on the first matched rule or if no rules match.
If not specified, the setting is determined via the following:
"juneau.restLogger.level"
system property."JUNEAU_RESTLOGGER_level"
environment variable."OFF" .
- Parameters:
value
- The new value for this property, ornull to use the default value.- Returns:
- This object.
-
normalRules
Adds logging rules to use when debug mode is not enabled.Logging rules are matched in the order they are added. The first to match wins.
- Parameters:
values
- The logging rules to add to the list of rules.- Returns:
- This object.
-
debugRules
Adds logging rules to use when debug mode is enabled.Logging rules are matched in the order they are added. The first to match wins.
- Parameters:
values
- The logging rules to add to the list of rules.- Returns:
- This object.
-
rules
Shortcut for adding the same rules as normal and debug rules.Logging rules are matched in the order they are added. The first to match wins.
- Parameters:
values
- The logging rules to add to the list of rules.- Returns:
- This object.
-
build
Instantiates a new call logger based on the settings in this builder.- Returns:
- A new call logger.
-