Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] How to log request time with milliseconds

Hi,

I suggest reading the javadoc for CustomRequestLog.

You can customize the logs generated by the request log with the format string supplied in the constructor.
The extended NCSA format is the string "%{client}a - %u %t \"%r\" %s %O \"%{Referer}i\" \"%{User-Agent}i\"", but you can modify that however you want.

As described in the javadoc you can set the time format you're looking for by replacing the "%t" in your format string to the following "%{HH:mm:ss,SSS}t".

cheers,
Lachlan

On Mon, Jul 24, 2023 at 8:48 PM jdison16--- via jetty-users <jetty-users@xxxxxxxxxxx> wrote:
Hello!

I am using AbstractNCSARequestLog with setLogDateFormat("HH:mm:ss,SSS"); to log in NCSA format with milliseconds.

Now in recent versions of Jetty this class was deleted with suggestion to use CustomRequestLog with EXTENDED_NCSA_FORMAT.

But it logs request time without millis.

Is there any simple way to log milliseconds too without writing my own CustomRequestLog with almost the same content (and delete DateCache logic).

Thanks in advance!
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jetty-users

Back to the top