Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CustomRequestLog lacks the ability to log RequestTime with millisecond precision #10153

Closed
trtrmitya opened this issue Jul 26, 2023 · 3 comments

Comments

@trtrmitya
Copy link

Jetty version(s)
11.x, 10.x, 9.x
Jetty 9.x is now at End of Community Support

Enhancement Description

I am in the process of migration from deprecated AbstractNCSARequestLog to CustomRequestLog.
AbstractNCSARequestLog has setLogDateFormat() method which accepts time pattern with "SSS" to log millis.
CustomRequestLog uses DateCache which does not allow time precision less than a second.

Thus I am unable to reproduce old behaviour and log milliseconds.

I have low traffic and do not need to cache formatted time, but I do need milliseconds in logs.

I am asking to add this functionality so I can log RequestTime with milliseconds precision like I did with (now removed) AbstractNCSARequestLog.

@lachlan-roberts
Copy link
Contributor

AbstractNCSARequestLog also used the DateCache class, so there should be no change of behaviour to use the CustomRequestLog with code %{HH:mm:ss,SSS}t to format the time.

Otherwise if you really need a more precise ms time we can consider adding another % code option for it.

@trtrmitya
Copy link
Author

Looks like format string does support "SSS", I see milliseconds in logs (at least with Jetty 10.0.15).
Sorry for the noice.

@lachlan-roberts
Copy link
Contributor

The work in #10176 makes it so that millisecond precision is the default from DateCache. So now closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants