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

Add option to suppress INFO logs in elastic_transport.transport while retaining WARNING and ERROR logs #363

Open
everaldorodrigo opened this issue Nov 22, 2024 · 0 comments

Comments

@everaldorodrigo
Copy link
Contributor

Feature Request

Currently, elastic_transport.transport logs every request at the INFO level, which can lead to cluttered logs in production environments. While INFO logs may not always be necessary, retaining WARNING and ERROR logs is critical for identifying potential issues and errors.

Use Case:

  • In a Tornado application interacting with Elasticsearch, frequent INFO logs from elastic_transport.transport dominate the log output. For example:
Nov 22 15:30:59 ip-172-30-1-34 python[115073]: [INFO elastic_transport.transport:271] POST http://elasticsearch:9200/mygene_index/_search?rest_total_hits_as_int=true [status:200 duration:0.006s]

These logs are less useful in normal operation but can mask more important WARNING and ERROR messages.

  • Current workaround involves manually setting the log level:
import logging
logging.getLogger("elastic_transport.transport").setLevel(logging.WARNING)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant