public static interface RequestLogger.Format
Ratpack provides the RequestLogger.ncsaFormat()
.
This can be used in conjunction with the RequestLogger.of(Action)
method, for fine grained control of how and when requests are logged.
Implementations should generally inspect the request outcome to determine if it needs to be logged,
and only calling the formatter if a log line is actually needed.
RequestLogger.of(Action)
,
RequestLogger.ncsaFormat()
Modifier and Type | Method and Description |
---|---|
void |
log(RequestOutcome requestOutcome,
RequestLogger.Router router)
The formatting function.
|
default RequestLogger |
to(RequestLogger.Router router)
Creates a logger that formats the the request and delegates to the given
router . |
default RequestLogger to(RequestLogger.Router router)
router
.router
- the destination for the log messagevoid log(RequestOutcome requestOutcome, RequestLogger.Router router)
Implementations should assemble a pattern and args set, and delegate to the given router
.
requestOutcome
- the request outcome to logrouter
- the destination of the logging information