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

HTTP Access Logs should allow ISO 8601 date format #40614

Closed
trixpan opened this issue May 14, 2024 · 8 comments · Fixed by #41252
Closed

HTTP Access Logs should allow ISO 8601 date format #40614

trixpan opened this issue May 14, 2024 · 8 comments · Fixed by #41252
Labels
area/logging kind/enhancement New feature or request
Milestone

Comments

@trixpan
Copy link
Contributor

trixpan commented May 14, 2024

Description

It is 2024. We are already asking how can we manage timestamps from Mars, yet in Quarkus we are stuck with a locale bound timestamp... :-)

09/May/2024:22:41:30 +000

Date and time, in Common Log Format format %t %{DATE_TIME}

There seems to be an undocumented %{time, option but who would want to use an undocumented option for something so critical?

Implementation ideas

No response

Copy link

quarkus-bot bot commented May 14, 2024

/cc @MichalMaler (documentation), @ebullient (documentation), @inoxx03 (documentation), @michelle-purcell (documentation), @rolfedh (documentation), @sheilamjones (documentation), @sunayna15 (documentation)

@maxandersen
Copy link
Member

@trixpan i'm having a challenge parsing your request/enhancement.

Are you saying that %{time} works for you and it does what you need and you just wish it was officially documented?
or saying that nothing seemed to work, please add a way to add iso formatting?

I'm actually personally surprised access log is using locale driven format by default :)

@gsmet
Copy link
Member

gsmet commented May 16, 2024

For the record, the date format is actually correct and follows the Common Log Format used for access logging since forever (that might explain the format not exactly in line with our modern habits...)

Quoting Wikipedia:

[10/Oct/2000:13:55:36 -0700] is the date, time, and time zone that the request was received, by default in strftime format %d/%b/%Y:%H:%M:%S %z.

From https://en.wikipedia.org/wiki/Common_Log_Format .

Now I don't know if there's a better format nowadays, that is widely used.

As for %{time,, it looks supported in DateTimeAttribute and allows to provide a custom format. We should probably add it to the doc.

@trixpan care to provide a patch for https://github.com/quarkusio/quarkus/blob/main/docs/src/main/asciidoc/http-reference.adoc?plain=1#L376 ?

@trixpan
Copy link
Contributor Author

trixpan commented May 16, 2024

@gsmet "correct" is subjective, after all, quarkus http logs may be json logs where the CLF doesn't directly apply, so restricting the logger abilities may be undesirable.

I get a PR on your way later today.

Cheers

@gsmet
Copy link
Member

gsmet commented May 16, 2024

So yes, but access logs are inherited from the good old Apache days. and CLF was well... common? (I was there!)

Now, yes, we should document the other option and also it would be nice to provide an example for ISO 8601 that people can just copy paste.

We could even imagine a shortcut but it seems risky given the number of various options supported.

Let's at least start with the doc, that's definitely something we need to document.

@maxandersen
Copy link
Member

@trixpan was there a doc pr made so we can close this now or ?

@trixpan
Copy link
Contributor Author

trixpan commented Jun 17, 2024

@maxandersen apologies, life has been insane in the last few weeks. PR can be found above.

@maxandersen
Copy link
Member

@maxandersen apologies, life has been insane in the last few weeks. PR can be found above.

Awesome. Welcome to hopefully more sanity :)

@gsmet gsmet added this to the 3.11.3 milestone Jun 18, 2024
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jun 18, 2024
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jun 18, 2024
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jun 18, 2024
holly-cummins pushed a commit to holly-cummins/quarkus that referenced this issue Jul 31, 2024
danielsoro pushed a commit to danielsoro/quarkus that referenced this issue Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/logging kind/enhancement New feature or request
Projects
Development

Successfully merging a pull request may close this issue.

5 participants