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

Disable console logging #20387

Merged
merged 5 commits into from
Sep 9, 2016
Merged

Disable console logging #20387

merged 5 commits into from
Sep 9, 2016

Conversation

jasontedor
Copy link
Member

Previously we would disable console logging in certain circumstances
(for example, if Elasticsearch is not in the foreground, or if
Elasticsearch is in the foreground but an exception was thrown during
bootstrap). This commit makes this handling work with Log4j 2. This will
prevent users from seeing double bootstrap check failure messages.

This commit migrates the methods TestLoggers#addAppender and
TestLoggers#removeAppenders to the class Loggers as these methods will
be needed in production code.
Previously we would disable console logging in certain circumstances
(for example, if Elasticsearch is not in the foreground, or if
Elasticsearch is in the foreground but an exception was thrown during
bootstrap). This commit makes this handling work with Log4j 2. This will
prevent users from seeing double bootstrap check failure messages.
@jasontedor
Copy link
Member Author

retest this please

1 similar comment
@jasontedor
Copy link
Member Author

retest this please

@jaymode
Copy link
Member

jaymode commented Sep 9, 2016

LGTM

This commit merely marks the clazz parameter on Loggers#findAppender as
final.
This commit adds a unit test for Loggers#findAppender. The idea behind
the test is to assert that we find an expected appender (a console
appender configured on the test logger), and to assert that we
successfully return null when a given appender is not present (a console
appender configured on a logger that only has a counting appender).
This commit adds even stronger assertions to the test
EvilLoggerTests#testFindAppender.
@jasontedor jasontedor merged commit d847548 into elastic:master Sep 9, 2016
@jasontedor jasontedor deleted the disable-console-logging branch September 9, 2016 13:15
@jasontedor
Copy link
Member Author

Thanks @jaymode!

jasontedor added a commit that referenced this pull request Sep 9, 2016
Previously we would disable console logging in certain circumstances
(for example, if Elasticsearch is not in the foreground, or if
Elasticsearch is in the foreground but an exception was thrown during
bootstrap). This commit makes this handling work with Log4j 2. This will
prevent users from seeing double bootstrap check failure messages.

Relates #20387
jasontedor added a commit that referenced this pull request Sep 9, 2016
Previously we would disable console logging in certain circumstances
(for example, if Elasticsearch is not in the foreground, or if
Elasticsearch is in the foreground but an exception was thrown during
bootstrap). This commit makes this handling work with Log4j 2. This will
prevent users from seeing double bootstrap check failure messages.

Relates #20387
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

3 participants