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

time field in pgx logs is repeated #58

Closed
josephschorr opened this issue Sep 2, 2021 · 2 comments · Fixed by #1253
Closed

time field in pgx logs is repeated #58

josephschorr opened this issue Sep 2, 2021 · 2 comments · Fixed by #1253
Labels
kind/bug Something is broken or regressed priority/3 low This would be nice to have

Comments

@josephschorr
Copy link
Member

josephschorr commented Sep 2, 2021

Right now, the time field in the pgx logs as output is repeated:

{"level":"info","module":"pgx","args":[],"commandTag":"...","sql":"begin read only","time":2.258174,"time":"2021-09-02T16:31:54Z","message":"Exec"}

Note that the produced JSON, when piped through tooling, loses one of the values

@josephschorr josephschorr added kind/bug Something is broken or regressed priority/3 low This would be nice to have labels Sep 2, 2021
@jakedt
Copy link
Member

jakedt commented Sep 27, 2021

in case it wasn't obvious: one is the number of milliseconds and one is the wall clock time

@josephschorr
Copy link
Member Author

@jakedt Yep, and I suspect one is being injected by the zerolog driver and one by pgx

josephschorr added a commit to josephschorr/cobrautil that referenced this issue Apr 5, 2023
This prevents it from replacing `time` keys on logs, particularly for pgx

First part of a fix for authzed/spicedb#58
josephschorr added a commit to josephschorr/spicedb that referenced this issue Apr 6, 2023
This ensures that all pgx supplied log keys are under the `pgx` key, to prevent overlap of the `time` keys

Example:
```
{"level":"debug","module":"pgx","pgx":{"args":[],"commandTag":"COMMIT","pid":110,"sql":"commit","time":0.434708},"time":"2023-01-01T01:01:00-00:00","message":"Query"}
```

Fixes authzed#58
jzelinskie pushed a commit to josephschorr/spicedb that referenced this issue Apr 6, 2023
This ensures that all pgx supplied log keys are under the `pgx` key, to prevent overlap of the `time` keys

Example:
```
{"level":"debug","module":"pgx","pgx":{"args":[],"commandTag":"COMMIT","pid":110,"sql":"commit","time":0.434708},"time":"2023-01-01T01:01:00-00:00","message":"Query"}
```

Fixes authzed#58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something is broken or regressed priority/3 low This would be nice to have
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants