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

Change log level #518

Closed
cortopy opened this issue May 21, 2021 · 2 comments
Closed

Change log level #518

cortopy opened this issue May 21, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@cortopy
Copy link

cortopy commented May 21, 2021

Description of the feature

In the default logger, any graphql that responds with errors is logged at error level: https://github.com/async-graphql/async-graphql/blob/master/src/extensions/logger.rs#L68

This is creating a lot of noise in my servers because I use sentry-log, which sends an error event to a sentry server each time something is logged at error! level. This wouldn't affect only this particular case, as any monitoring tool that parses and notifies on errors logged in stdout will suffer from the same amount of false positives.

As far as I understand logging levels, not every response with errors is an error in itself. Anything that in a HTTP server has status lower than 500 is not an error to be concerned about. For example:

  • user submits form with invalid values
  • someone tries to log in with wrong credentials
  • etc.

Is changing the log level to info! something that could be considered? I could implement my own Logger extension but I guess other users may benefit from this change too

@cortopy cortopy added the enhancement New feature or request label May 21, 2021
@sunli829
Copy link
Collaborator

You are right, I changed the error log level. 😁

sunli829 added a commit that referenced this issue Sep 24, 2021
@sunli829
Copy link
Collaborator

Released in v2.10.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants