diff --git a/jetty-documentation/src/main/asciidoc/administration/logging/configuring-jetty-request-logs.adoc b/jetty-documentation/src/main/asciidoc/administration/logging/configuring-jetty-request-logs.adoc index dd452a02efd..44c7334c761 100644 --- a/jetty-documentation/src/main/asciidoc/administration/logging/configuring-jetty-request-logs.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/logging/configuring-jetty-request-logs.adoc @@ -91,7 +91,29 @@ By default, log files are kept for 90 days before being deleted. The value for `retainDays` (xml) or `setRetainDays` (Java) should be configured as _1 + n_ days. For example, if you wanted to keep the logs for the current day and the day prior you would set the `retainDays` (or `setRetainDays`) value to 2. -To examine more configuration options, see link:{JDURL}/org/eclipse/jetty/server/NCSARequestLog.html[NCSARequestLog.java]. + +[[request-log-custom-writer]] +==== Introducing RequestLog.Writer + +The concept of a `RequestLog.Writer`, introduced in Jetty 9.4.15, manages the writing to a log the string generated by the `RequestLog`. +This allows the `CustomRequestLog` to match the functionality of other `RequestLogger` implementations by plugging in any `RequestLog.Writer` and a custom format string. +Jetty currently has implementations of `RequestLog.Writer`, `RequestLogWriter`, `AsyncRequestLogWriter`, and `Slf4jRequestLogWriter`. + +So, the way to create an asynchronous `RequestLog` using the extended NCSA format has been changed from: + +`new AsyncNcsaRequestLog(filename)` + +to: + +`new CustomRequestLog(new AsyncRequestLogWriter(filename), CustomRequestLog.EXTENDED_NCSA_FORMAT)` + +Additionally, there are now two settings for the log timezone to be configured. +There is the configuration for logging the request time, which is set in the `timeZone` parameter in the `%t` format code of the string, given in the format `%{format|timeZone|locale}t`. + +The other `timeZone` parameter relates to the generation of the log file name (both at creation and roll over). +This is configured in the `requestlog` module file, or can be used as a setter on `RequestLogWriter` via XML. + +Both timezones are set to GMT by default. [[configuring-separate-request-log-for-web-application]] ==== Configuring a Separate Request Log For a Web Application