fix: remove duplicate request logging #49

Closed
opened 2025-07-08 08:38:26 -04:00 by AtHeartEngineer · 0 comments

Originally created by @ryankask on 6/24/2025

Gin's default engine constructor already adds the logger by default: https://github.com/gin-gonic/gin/blob/v1.10.0/gin.go#L224


I noticed requests being logged twice in the logs and found some related issues in the Gin repo. This may be related to #294 where the user noticed excessive logging.

Before:

❯ xh http://localhost:1411/healthz
HTTP/1.1 204 No Content
Date: Tue, 24 Jun 2025 07:46:20 GMT

[GIN] 2025/06/24 - 08:46:20 | 204 |         917ns |       127.0.0.1 | GET      "/healthz"
[GIN] 2025/06/24 - 08:46:20 | 204 |      33.791µs |       127.0.0.1 | GET      "/healthz"

After:

❯ xh http://localhost:1411/healthz
HTTP/1.1 204 No Content
Date: Tue, 24 Jun 2025 07:47:19 GMT

[GIN] 2025/06/24 - 08:47:19 | 204 |      14.958µs |       127.0.0.1 | GET      "/healthz"
*Originally created by @ryankask on 6/24/2025* Gin's default engine constructor already adds the logger by default: https://github.com/gin-gonic/gin/blob/v1.10.0/gin.go#L224 --- I noticed requests being logged twice in the logs and found some related issues in the Gin repo. This may be related to #294 where the user noticed excessive logging. Before: ``` ❯ xh http://localhost:1411/healthz HTTP/1.1 204 No Content Date: Tue, 24 Jun 2025 07:46:20 GMT [GIN] 2025/06/24 - 08:46:20 | 204 | 917ns | 127.0.0.1 | GET "/healthz" [GIN] 2025/06/24 - 08:46:20 | 204 | 33.791µs | 127.0.0.1 | GET "/healthz" ``` After: ``` ❯ xh http://localhost:1411/healthz HTTP/1.1 204 No Content Date: Tue, 24 Jun 2025 07:47:19 GMT [GIN] 2025/06/24 - 08:47:19 | 204 | 14.958µs | 127.0.0.1 | GET "/healthz" ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/pocket-id#49