You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Benefits:
- Removes `unsafePerformIO` from Logger
- Reuses our cached time getter (`stateGetZTime`) instead of having another unnecessary one.
See https://github.com/yesodweb/wai//blob/d50e1184600631a114e3d2ad119abdf0ef08834b/wai-extra/Network/Wai/Middleware/RequestLogger/Internal.hs#L22-L37.
- Reuses Observation module, simplified logic
- Will help with log buffering #4061
TODO:
- [ ] Currently we vendor `apacheLogStr`, but might be possible to
expose this function upstream. If not, it's not a big problem since
the function is small.
- [ ] Time in logging differs a bit:
```
Old: postgrest_test_anonymous [04/May/2025:14:43:06 -0500]
New: postgrest_test_anonymous [2025-05-04 22:43:01.28098247 -05]
```
+ Otherwise all logging works the same.
- [ ] Auth error logging relies on old logger middleware
+ We might need to put `observer` in Auth.hs
+ Or otherwise try to combine this with #4059
-- TODO Wai.contentLength does a lookup everytime, see https://hackage.haskell.org/package/wai-extra-3.1.17/docs/src/Network.Wai.Header.html#contentLength
121
+
-- It might be possible to gain some perf by returning the response length from `postgrestResponse`. We calculate the length manually on Response.hs.
122
+
(Wai.contentLength $Wai.responseHeaders response)
123
+
119
124
-- Launch the connWorker when the connection is down. The postgrest
120
125
-- function can respond successfully (with a stale schema cache) before
0 commit comments