Increase visibility of deprecation logger

The deprecation logger is an important way to make visible features of
Elasticsearch that are deprecated. Yet, the default logging makes the
log messages for the deprecation logger invisible. We want these log
messages to be visible, so the default logging for the deprecation
logger should enable these log messages. This commit changes the log
level of deprecation log message to warn, and configures the deprecation
logger so that these log messages are visible out of the box.

Relates #20254
This commit is contained in:
Jason Tedor 2016-08-31 10:51:17 -04:00 committed by GitHub
parent 6f8a047942
commit 1a805bb675
4 changed files with 11 additions and 8 deletions

View File

@ -131,9 +131,9 @@ public class DeprecationLogger {
}
}
logger.debug(formattedMsg);
logger.warn(formattedMsg);
} else {
logger.debug(msg, params);
logger.warn(msg, params);
}
}

View File

@ -138,7 +138,7 @@ public class ESLoggerTests extends ESTestCase {
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"));
}

View File

@ -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

View File

@ -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`.