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 log contains duplicate entries when rerouting requests #30845

Closed
brahim-raddahi opened this issue Feb 3, 2023 · 2 comments
Closed
Labels
area/vertx kind/bug Something isn't working triage/wontfix This will not be worked on

Comments

@brahim-raddahi
Copy link

Describe the bug

When using a RouteFilter to reroute requests, the access log handler seems to be added multiple times, resulting in multiple lines for the same request in the access log.

This:
https://github.com/quarkusio/quarkus/blob/3.0.0.Alpha2/extensions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/filters/accesslog/AccessLogHandler.java#L145

Should only be triggered once per RoutingContext

Sidenote: there does not seem to be an option to refer to the "original request" variables vs the rewritten ones (Apache uses ">" and "<" for this), the logged path for example will be the rewritten/rerouted one

Expected behavior

The access log should contain only one line per request

Actual behavior

The access log contains multiple lines per request

How to Reproduce?

  1. start from the "getting-started" project at https://github.com/quarkusio/quarkus-quickstarts/tree/main/getting-started
  2. add the dependency quarkus-vertx-web to the pom.xml file
  3. add this class: GreetingRerouter.txt
  4. compile the project
  5. run it with access logs enabled: java -Dquarkus.http.access-log.enabled=true -Dquarkus.http.access-log.log-to-file=true -Dquarkus.http.access-log.log-directory=/opt/testapp/log -jar quarkus-run.jar
  6. start a request: curl http://localhost:8080/
  7. the access log contains two entries per request

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@geoand
Copy link
Contributor

geoand commented Feb 6, 2023

This happens because you are rerouting requests

@geoand geoand closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2023
@geoand geoand added the triage/wontfix This will not be worked on label Feb 6, 2023
@sschellh
Copy link

sschellh commented Aug 8, 2023

Hello,

I observe the same behavior and for me this feels like a bug. Rerouting should not cause two entries in the access log. Otherwise it looks like two requests did hit the server, while in fact it was just one (that was internally reroutet).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/vertx kind/bug Something isn't working triage/wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants