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:
parent
6f8a047942
commit
1a805bb675
|
@ -131,9 +131,9 @@ public class DeprecationLogger {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.debug(formattedMsg);
|
logger.warn(formattedMsg);
|
||||||
} else {
|
} else {
|
||||||
logger.debug(msg, params);
|
logger.warn(msg, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,7 +138,7 @@ public class ESLoggerTests extends ESTestCase {
|
||||||
List<LoggingEvent> deprecationEvents = deprecationAppender.getEvents();
|
List<LoggingEvent> deprecationEvents = deprecationAppender.getEvents();
|
||||||
LoggingEvent event = deprecationEvents.get(0);
|
LoggingEvent event = deprecationEvents.get(0);
|
||||||
assertThat(event, notNullValue());
|
assertThat(event, notNullValue());
|
||||||
assertThat(event.getLevel(), equalTo(Level.DEBUG));
|
assertThat(event.getLevel(), equalTo(Level.WARN));
|
||||||
assertThat(event.getRenderedMessage(), equalTo("This is a deprecation message"));
|
assertThat(event.getRenderedMessage(), equalTo("This is a deprecation message"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@ logger:
|
||||||
# log action execution errors for easier debugging
|
# log action execution errors for easier debugging
|
||||||
action: DEBUG
|
action: DEBUG
|
||||||
|
|
||||||
# deprecation logging, turn to DEBUG to see them
|
# deprecation logging, turn to INFO to disable them
|
||||||
deprecation: INFO, deprecation_log_file
|
deprecation: WARN, deprecation_log_file
|
||||||
|
|
||||||
# reduce the logging for aws, too much is logged under the default INFO
|
# reduce the logging for aws, too much is logged under the default INFO
|
||||||
com.amazonaws: WARN
|
com.amazonaws: WARN
|
||||||
|
|
|
@ -136,14 +136,17 @@ out of the box.
|
||||||
In addition to regular logging, Elasticsearch allows you to enable logging
|
In addition to regular logging, Elasticsearch allows you to enable logging
|
||||||
of deprecated actions. For example this allows you to determine early, if
|
of deprecated actions. For example this allows you to determine early, if
|
||||||
you need to migrate certain functionality in the future. By default,
|
you need to migrate certain functionality in the future. By default,
|
||||||
deprecation logging is disabled. You can enable it in the `config/logging.yml`
|
deprecation logging is enabled at the WARN level, the level at which all
|
||||||
file by setting the deprecation log level to `DEBUG`.
|
deprecation log messages will be emitted.
|
||||||
|
|
||||||
[source,yaml]
|
[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.
|
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
|
Check this file regularly, especially when you intend to upgrade to a new
|
||||||
major version.
|
major version.
|
||||||
|
|
||||||
|
You can disable it in the `config/logging.yml` file by setting the deprecation
|
||||||
|
log level to `INFO`.
|
||||||
|
|
Loading…
Reference in New Issue