The "Common Log Format" used by apache is supposed to show the current user "as determined by HTTP authentication". This is not implemented in wai-logger, yet:
Since there is, afaik, no "WAI standard" on how to get that user, this PR adds the ability to pass in a getter to initLogger which will then read the current user from the Request. This would allow to pass in a helper around wai-middleware-auth's getAuthUser or allow to do something similar in PostgREST (https://github.com/PostgREST/postgrest/pull/1988).
If this was merged, I'd follow up with a PR to wai-extra to make it available in mkRequestLogger.
The "Common Log Format" used by apache is supposed to show the current user "as determined by HTTP authentication". This is not implemented in
wai-logger
, yet:https://github.com/kazu-yamamoto/logger/blob/cde8404e9f37a0202655f99da04fd5326d9ea6c7/wai-logger/Network/Wai/Logger/Apache.hs#L81
The second
-
is supposed to be the user.Since there is, afaik, no "WAI standard" on how to get that user, this PR adds the ability to pass in a getter to
initLogger
which will then read the current user from theRequest
. This would allow to pass in a helper aroundwai-middleware-auth
'sgetAuthUser
or allow to do something similar in PostgREST (https://github.com/PostgREST/postgrest/pull/1988).If this was merged, I'd follow up with a PR to
wai-extra
to make it available inmkRequestLogger
.