Skip to content

Conversation

@mhl
Copy link
Contributor

@mhl mhl commented Jan 19, 2015

If there are no loggers defined for the elasticsearch Python package you
get errors like the following:

No handlers could be found for logger "elasticsearch" (in production)
No handlers could be found for logger "elasticsearch.trace" (local dev)

(I'm not sure why there's that difference in those logger names.)

This commit sets up loggers for both names in the Django settings module
that will send any logging of level INFO and above to standard error.
This suppresses that warning and should mean that we're able to see
real warnings and errors in the logs.

mhl added 2 commits January 19, 2015 14:54
If there are no loggers defined for the elasticsearch Python package you
get errors like the following:

  No handlers could be found for logger "elasticsearch" (in production)
  No handlers could be found for logger "elasticsearch.trace" (local dev)

(I'm not sure why there's that difference in those logger names.)

This commit sets up loggers for both names in the Django settings module
that will send any logging of level INFO and above to standard error.
This suppresses that warning and should mean that we're able to see
real warnings and errors in the logs.
Now that elasticsearch warnings are being sent to standard error, this
one has become apparent:

  List of nodes should not include schema information (http://): 'http://127.0.0.1:9200'.

... which can be fixed by removing the schema from the URL in
HAYSTACK_CONNECTIONS.
@davea
Copy link
Member

davea commented Jan 19, 2015

It appears that the logging message being generated and causing the error is:

List of nodes should not include schema information (http://): 'http://127.0.0.1:9200'.

This was fixed in elastic/elasticsearch-py#149 and the latest version of elasticsearch on pypi (1.3.0, pombola uses 1.2.0 right now) doesn't exhibit the log warning behaviour.

In any case, this PR LGTM 👍

@mhl mhl merged commit cce8503 into master Jan 19, 2015
@jacksonj04 jacksonj04 deleted the fix-elasticsearch-logger-warnings branch July 28, 2015 12:57
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

Successfully merging this pull request may close these issues.

3 participants