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

Request time not logged in access.log #13129

Closed
blsouthr opened this issue Nov 5, 2020 · 13 comments
Closed

Request time not logged in access.log #13129

blsouthr opened this issue Nov 5, 2020 · 13 comments
Labels
kind/bug Something isn't working triage/out-of-date This issue/PR is no longer valid or relevant

Comments

@blsouthr
Copy link

blsouthr commented Nov 5, 2020

Describe the bug
I used documentation to configure access.log and modified combined format to include time taken to process request %D or %{RESPONSE_TIME} or %T

quarkus.http.access-log.pattern=%{REMOTE_HOST} %l %{REMOTE_USER} %{DATE_TIME} "%{REQUEST_LINE}" %{RESPONSE_CODE} %b %{RESPONSE_TIME} %T

The output:
2020-11-05 10:16:04,569 INFO [io.qua.htt.access-log] (executor-thread-174) 127.0.0.1 - - 05/Nov/2020:10:16:04 +0100 "GET /api HTTP/1.1" 200 17 - -

As you can see, last two entries are empty.

Btw, what is %l config option? There is no description in the documentation, but it is used in combined format

@blsouthr blsouthr added the kind/bug Something isn't working label Nov 5, 2020
@gsmet
Copy link
Member

gsmet commented Nov 5, 2020

/cc @stuartwdouglas

@andrerigon
Copy link
Contributor

andrerigon commented Nov 5, 2020

We are seeing the same problem here.

@gsmet
Copy link
Member

gsmet commented Nov 5, 2020

Could you post the list of extensions printed at startup so that we know more about your setups? Thanks!

@blsouthr
Copy link
Author

blsouthr commented Nov 5, 2020

@gsmet

[cdi, mailer, mutiny, qute, resteasy, resteasy-jackson, scheduler, smallrye-context-propagation, smallrye-fault-tolerance, smallrye-health, smallrye-metrics, vertx]

I don't have mutiny, qute in pom.xml

@andrerigon
Copy link
Contributor

[cdi, hibernate-validator, kotlin, micrometer, mutiny, redis-client, resteasy, resteasy-jackson, resteasy-mutiny, scheduler, smallrye-context-propagation, smallrye-fault-tolerance, smallrye-health, vertx, vertx-web]

@jaikiran
Copy link
Member

Hello @blsouthr,

Btw, what is %l config option? There is no description in the documentation, but it is used in combined format

As per the javadoc on the relevant class[1], it stands for:

Remote logical username from identd (always returns '-')

[1] https://github.com/quarkusio/quarkus/blob/master/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/filters/accesslog/AccessLogHandler.java#L50

@jaikiran
Copy link
Member

Hello @blsouthr, @andrerigon,

Looking at the code in the ResponseTimeAttribute[1] which is responsible for providing the response time value, it requires the request start time to be set in the exchange. The HTTP configuration of Quarkus, by defaults disables it[2]. Can you add the following to your application.properties file and see if it works:

quarkus.http.record-request-start-time=true

[1] https://github.com/quarkusio/quarkus/blob/master/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/attribute/ResponseTimeAttribute.java#L30
[2] https://github.com/quarkusio/quarkus/blob/master/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/HttpConfiguration.java#L196

@gsmet
Copy link
Member

gsmet commented Nov 28, 2020

I wonder if we could at least raise a warning in this case. And in any case, we would need a mention in the table here: https://quarkus.io/guides/http-reference#configuring-http-access-logs as it's not exactly obvious :).

@blsouthr
Copy link
Author

blsouthr commented Dec 9, 2020

Hi @jaikiran

quarkus.http.record-request-start-time=true

solved the problem. Thanks!

@andrerigon
Copy link
Contributor

Hi @jaikiran,

solved for me too. Thanks!

@ebullient
Copy link
Member

Can this be closed?

@jaikiran
Copy link
Member

Sorry, the linked PR is still open and I need to fix that review commetns that gsmet asked for.

@geoand
Copy link
Contributor

geoand commented Feb 27, 2024

Closing as #35588 was merged

@geoand geoand closed this as completed Feb 27, 2024
@geoand geoand added the triage/out-of-date This issue/PR is no longer valid or relevant label Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working triage/out-of-date This issue/PR is no longer valid or relevant
Projects
None yet
Development

No branches or pull requests

6 participants