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

Avoid noisy stack traces when Elasticsearch is not available #3934

Merged
merged 1 commit into from Jun 27, 2017

Conversation

bernd
Copy link
Member

@bernd bernd commented Jun 23, 2017

Only log stack traces if debug logging is enabled.

Closes #3861

Especially Cluster#isConnectec() should not log anything if Elasticsearch is not reachable.

A starting/running Graylog server without Elasticsearch logs only this instead of pages of stack traces now.

2017-06-23 14:32:47,783 ERROR: org.graylog2.indexer.cluster.Cluster - Couldn't read cluster health for indices [graylog_*, emails_*, yolo_*] (Could not connect to http://127.0.0.1:9200)
2017-06-23 14:32:47,783 INFO : org.graylog2.periodical.IndexerClusterCheckerThread - Indexer not fully initialized yet. Skipping periodic cluster check.
2017-06-23 14:33:17,788 ERROR: org.graylog2.indexer.cluster.Cluster - Couldn't read cluster health for indices [graylog_*, emails_*, yolo_*] (Could not connect to http://127.0.0.1:9200)
2017-06-23 14:33:17,788 INFO : org.graylog2.periodical.IndexerClusterCheckerThread - Indexer not fully initialized yet. Skipping periodic cluster check.
2017-06-23 14:33:17,942 WARN : org.graylog2.migrations.V20161130141500_DefaultStreamRecalcIndexRanges - Interrupted or timed out waiting for Elasticsearch cluster, checking again.
2017-06-23 14:33:27,804 ERROR: org.graylog2.alerts.AlertScanner - Skipping alert check <yolo/2fa6a415-ce0c-4a36-accc-dd9519eb06d9>: Unable to perform count query. (ElasticsearchException)
2017-06-23 14:33:47,786 ERROR: org.graylog2.indexer.cluster.Cluster - Couldn't read cluster health for indices [graylog_*, emails_*, yolo_*] (Could not connect to http://127.0.0.1:9200)
2017-06-23 14:33:47,787 INFO : org.graylog2.periodical.IndexerClusterCheckerThread - Indexer not fully initialized yet. Skipping periodic cluster check.
2017-06-23 14:34:17,787 ERROR: org.graylog2.indexer.cluster.Cluster - Couldn't read cluster health for indices [graylog_*, emails_*, yolo_*] (Could not connect to http://127.0.0.1:9200)
2017-06-23 14:34:17,787 INFO : org.graylog2.periodical.IndexerClusterCheckerThread - Indexer not fully initialized yet. Skipping periodic cluster check.

Only log stack traces if debug logging is enabled.

Closes #3861
@bernd bernd added this to the 2.3.0 milestone Jun 23, 2017
return numberOfDataNodes > 0;
} catch (ElasticsearchException e) {
if (LOG.isDebugEnabled()) {
LOG.error(e.getMessage(), e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong log level?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was intentional. The idea was to only show the error if debugging is enabled so it's easier to identify the log message is an error.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return numberOfDataNodes > 0;
} catch (ElasticsearchException e) {
if (LOG.isDebugEnabled()) {
LOG.error(e.getMessage(), e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joschi joschi self-assigned this Jun 27, 2017
@joschi joschi merged commit 6d98f00 into master Jun 27, 2017
@joschi joschi deleted the issue-3861 branch June 27, 2017 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants