LOG4J2-124 change behaviour of no-param shutdown() method to mean shutdown(false), improve documentation
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/01626e25 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/01626e25 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/01626e25 Branch: refs/heads/master Commit: 01626e25bba31ed42af00b2301546f9b1199b720 Parents: 71cd7c4 Author: rpopma <[email protected]> Authored: Mon Jan 25 22:21:34 2016 +0900 Committer: rpopma <[email protected]> Committed: Mon Jan 25 22:21:34 2016 +0900 ---------------------------------------------------------------------- .../main/java/org/apache/logging/log4j/LogManager.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/01626e25/log4j-api/src/main/java/org/apache/logging/log4j/LogManager.java ---------------------------------------------------------------------- diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/LogManager.java b/log4j-api/src/main/java/org/apache/logging/log4j/LogManager.java index d1560c7..8fdb718 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/LogManager.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/LogManager.java @@ -286,16 +286,23 @@ public class LogManager { } /** - * Shutdown using the default LoggerContext. + * Shutdown using the LoggerContext appropriate for the caller of this method. + * This is equivalent to calling {@code LogManager.shutdown(false)}. * @since 2.6 */ public static void shutdown() { - shutdown(getContext()); + shutdown(false); } /** * Shutdown the logging system if the logging system supports it. - * @param currentContext if true the LoggerContext for the caller of this method will be used. + * This is equivalent to calling {@code LogManager.shutdown(LogManager.getContext(currentContext))}. + * @param currentContext if true a default LoggerContext (may not be the LoggerContext used to create a Logger + * for the calling class) will be used. + * If false the LoggerContext appropriate for the caller of this method is used. For + * example, in a web application if the caller is a class in WEB-INF/lib then one LoggerContext may be + * used and if the caller is a class in the container's classpath then a different LoggerContext may + * be used. * @since 2.6 */ public static void shutdown(boolean currentContext) {
