Last active
May 22, 2017 21:28
-
-
Save bryder/fa3a02c52268c323b7b5b7b99da08a53 to your computer and use it in GitHub Desktop.
Shut up elastic debug logging if you change it globally and disable warnings about insecure ssl etc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
logging.getLogger('elasticsearch.trace').setLevel(logging.WARNING) | |
logging.getLogger('elasticsearch').setLevel(logging.WARNING) | |
import urllib3 | |
urllib3.disable_warnings() # Gets some of the warnings - but not the one from elasticsearch | |
with warnings.catch_warnings(): | |
warnings.filterwarnings("ignore", ".*using SSL with verify_certs=False is insecure.*") | |
es = elasticsearch.Elasticsearch(url, retry_on_status=[503, 504, 401], **kwargs) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment