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

[FEATURE] Add option to turn off success logs #377

Open
crystaldust opened this issue Apr 27, 2023 · 3 comments
Open

[FEATURE] Add option to turn off success logs #377

crystaldust opened this issue Apr 27, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@crystaldust
Copy link

crystaldust commented Apr 27, 2023

Is your feature request related to a problem?

No

What solution would you like?

An argument to opensearch client's __init__ method to turn off the successful requests log

What alternatives have you considered?

Describe in the next section :)

Do you have any additional context?

After reading the code, the Conneciton instance method perform_request will call log_request_success each time the request is made. Currently the only way to turn off this default behavior is to setting 'opensearch' logger's level to a higher level than INFO, by code like this:

import logging
logging.getLogger("opensearch").setLevel(logging.INFO)

Which force the developer to look inside the library's code and set the log level manually.

@wbeckler
Copy link
Contributor

wbeckler commented May 4, 2023

This makes sense. Logging too much can be worse than not logging enough, especially if it's not obvious that it's happening.

@wbeckler wbeckler removed the untriaged Need triage label May 10, 2023
@dblock
Copy link
Member

dblock commented Nov 10, 2023

@crystaldust Any interest in picking this up?

@dblock dblock changed the title [FEATURE] Option to turn off success logs(which is by default) [FEATURE] Add option to turn off success logs Nov 10, 2023
@dblock
Copy link
Member

dblock commented Nov 18, 2023

I reduced the amount of unnecessary processing in logging in #571, but we should be able to do more.

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

3 participants