-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add log level config #1604
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
Add log level config #1604
Conversation
+1 for making Personally I have never used the logging output of postgrest so far, except for everything that's there with Over in #1596 a distinction between errors in the 4xx and in the 5xx range is made. I think that makes a lot of sense. Imho, everything in the 4xx range is more or less expected (or at least handled properly), while those errors in 5xx deserve a lot more attention. Do you think it's possible to make a difference here? I would probably turn on If this distinction makes sense to you as well, it could be like this:
(In that case, I would tend to make |
Good call! I'll add the
So do you think we should have I'm tempted to make |
My reasoning to make
|
@wolfgangwalther Totally agree on the reasoning for making
No errors on the benchmark - one single req is tested and non-200 are checked.
I think the next step for this would be adding the For now I'm happy with the results. Let me know if you agree and I'll merge :) |
LGTM! |
5c3af02
to
b8eafbe
Compare
(ci/circlei: stack-test failed because io-tests are flaky: |
If it'd slow things down too much and just show what's in postgres's access logs anyway, I understand not adding |
@elimisteve Sorry, this somehow fell off my radar. I've actually seen that before, but thought it was an user error. Please open an issue if you encounter it again so we can track it.
|
Add the
log-level
config option. The admitted values are:crit
: No requests are logged. Only startup and db connection recovery messages are logged.error
: Only failed requests(status >=400) are logged.info
: All requests are logged. This is the only level we've been offering until now.Partly addresses: #540 (
debug
level for another PR).Perf
According to my load tests, the lower levels give more requests per second:
crit
: 208 req/s more on average.error
: 170 req/s more on average.Which makes sense because our default
info
level doesn't buffer the log messages. It writes them to disk, directly.The
error
level is a bit slower because of the status filtering.Changing the default log level
error
? It certainly looks better for production.access.log
already contains the logged requests. In these cases thecrit
level could be used. Since we're usually behind a proxy, perhaps we could default tocrit
instead?