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

Projects
None yet
2 participants
@bernd
Member

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.
Avoid noisy stack traces when Elasticsearch is not available
Only log stack traces if debug logging is enabled.

Closes #3861

@bernd bernd added this to the 2.3.0 milestone Jun 23, 2017

@bernd bernd requested review from dennisoelkers, joschi and kroepke Jun 23, 2017

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

This comment has been minimized.

@joschi

joschi Jun 27, 2017

Contributor

Wrong log level?

This comment has been minimized.

@bernd

bernd Jun 27, 2017

Member

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.

This comment has been minimized.

@joschi

joschi Jun 27, 2017

Contributor

@joschi

joschi approved these changes Jun 27, 2017

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

This comment has been minimized.

@joschi

joschi Jun 27, 2017

Contributor

@joschi joschi self-assigned this Jun 27, 2017

@joschi joschi merged commit 6d98f00 into master Jun 27, 2017

4 checks passed

ci-web-linter Jenkins build graylog-pr-linter-check 1778 has succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
graylog-project/pr Jenkins build graylog-project-pr-snapshot 276 has succeeded
Details

@joschi joschi deleted the issue-3861 branch Jun 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment