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

Increase visibility of deprecation logger #20254

Merged
merged 2 commits into from
Aug 31, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ void deprecated(Set<ThreadContext> threadContexts, String msg, Object... params)
}
}

logger.debug(formattedMsg);
logger.warn(formattedMsg);
} else {
logger.debug(msg, params);
logger.warn(msg, params);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public void testDeprecationLogger() {
List<LoggingEvent> deprecationEvents = deprecationAppender.getEvents();
LoggingEvent event = deprecationEvents.get(0);
assertThat(event, notNullValue());
assertThat(event.getLevel(), equalTo(Level.DEBUG));
assertThat(event.getLevel(), equalTo(Level.WARN));
assertThat(event.getRenderedMessage(), equalTo("This is a deprecation message"));
}

Expand Down
4 changes: 2 additions & 2 deletions distribution/src/main/resources/config/logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ logger:
# log action execution errors for easier debugging
action: DEBUG

# deprecation logging, turn to DEBUG to see them
deprecation: INFO, deprecation_log_file
# deprecation logging, turn to INFO to disable them
deprecation: WARN, deprecation_log_file

# reduce the logging for aws, too much is logged under the default INFO
com.amazonaws: WARN
Expand Down
9 changes: 6 additions & 3 deletions docs/reference/setup/configuration.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,17 @@ out of the box.
In addition to regular logging, Elasticsearch allows you to enable logging
of deprecated actions. For example this allows you to determine early, if
you need to migrate certain functionality in the future. By default,
deprecation logging is disabled. You can enable it in the `config/logging.yml`
file by setting the deprecation log level to `DEBUG`.
deprecation logging is enabled at the WARN level, the level at which all
deprecation log messages will be emitted.

[source,yaml]
--------------------------------------------------
deprecation: DEBUG, deprecation_log_file
deprecation: WARN, deprecation_log_file
--------------------------------------------------

This will create a daily rolling deprecation log file in your log directory.
Check this file regularly, especially when you intend to upgrade to a new
major version.

You can disable it in the `config/logging.yml` file by setting the deprecation
log level to `INFO`.