You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rp...@apache.org on 2016/01/25 14:21:28 UTC

[1/2] logging-log4j2 git commit: LOG4J2-124 remove convenience methods

Repository: logging-log4j2
Updated Branches:
  refs/heads/master 8b2f7f675 -> 01626e25b


LOG4J2-124 remove convenience methods


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/71cd7c46
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/71cd7c46
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/71cd7c46

Branch: refs/heads/master
Commit: 71cd7c4631f390f6ecad88b6725ade495ef7be70
Parents: 8b2f7f6
Author: rpopma <rp...@apache.org>
Authored: Mon Jan 25 22:00:21 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Mon Jan 25 22:00:21 2016 +0900

----------------------------------------------------------------------
 .../org/apache/logging/log4j/LogManager.java    | 55 ++++----------------
 1 file changed, 11 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/71cd7c46/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 64c6ee5..d1560c7 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
@@ -147,7 +147,7 @@ public class LogManager {
      * WARNING - The LoggerContext returned by this method may not be the LoggerContext used to create a Logger for the
      * calling class.
      * </p>
-     * 
+     *
      * @return The current LoggerContext.
      */
     public static LoggerContext getContext() {
@@ -256,7 +256,7 @@ public class LogManager {
 
     /**
      * Returns a LoggerContext
-     * 
+     *
      * @param fqcn The fully qualified class name of the Class that this method is a member of.
      * @param currentContext if false the LoggerContext appropriate for the caller of this method is returned. For
      *            example, in a web application if the caller is a class in WEB-INF/lib then one LoggerContext may be
@@ -270,7 +270,7 @@ public class LogManager {
 
     /**
      * Returns a LoggerContext
-     * 
+     *
      * @param fqcn The fully qualified class name of the Class that this method is a member of.
      * @param loader The ClassLoader for the context. If null the context will attempt to determine the appropriate
      *            ClassLoader.
@@ -304,17 +304,6 @@ public class LogManager {
 
     /**
      * Shutdown the logging system if the logging system supports it.
-     * @param loader The ClassLoader for the context. If null the context will attempt to determine the appropriate
-     *            ClassLoader.
-     * @param currentContext if false the LoggerContext appropriate for the caller of this method will be used.
-     * @since 2.6
-     */
-    public static void shutdown(final ClassLoader loader, final boolean currentContext) {
-        shutdown(getContext(loader, currentContext));
-    }
-
-    /**
-     * Shutdown the logging system if the logging system supports it.
      * @param context the LoggerContext.
      * @since 2.6
      */
@@ -325,30 +314,8 @@ public class LogManager {
     }
 
     /**
-     * Shutdown the logging system if the logging system supports it.
-     * @param fqcn The fully qualified class name of the Class that this method is a member of.
-     * @param currentContext if false the LoggerContext appropriate for the caller of this method will be used.
-     * @since 2.6
-     */
-    protected static void shutdown(final String fqcn, final boolean currentContext) {
-        shutdown(getContext(fqcn, currentContext));
-    }
-
-    /**
-     * Shutdown the logging system if the logging system supports it.
-     * @param fqcn The fully qualified class name of the Class that this method is a member of.
-     * @param loader The ClassLoader for the context. If null the context will attempt to determine the appropriate
-     *            ClassLoader.
-     * @param currentContext if false the LoggerContext appropriate for the caller of this method will be used.
-     * @since 2.6
-     */
-    protected static void shutdown(final String fqcn, final ClassLoader loader, final boolean currentContext) {
-        shutdown(getContext(fqcn, loader, currentContext));
-    }
-
-    /**
      * Returns the current LoggerContextFactory.
-     * 
+     *
      * @return The LoggerContextFactory.
      */
     public static LoggerContextFactory getFactory() {
@@ -378,7 +345,7 @@ public class LogManager {
      * <p>
      * This logger lets you use a {@link java.util.Formatter} string in the message to format parameters.
      * </p>
-     * 
+     *
      * @return The Logger for the calling class.
      * @throws UnsupportedOperationException if the calling class cannot be determined.
      * @since 2.4
@@ -495,7 +462,7 @@ public class LogManager {
 
     /**
      * Returns a Logger with the name of the calling class.
-     * 
+     *
      * @return The Logger for the calling class.
      * @throws UnsupportedOperationException if the calling class cannot be determined.
      */
@@ -505,7 +472,7 @@ public class LogManager {
 
     /**
      * Returns a Logger using the fully qualified name of the Class as the Logger name.
-     * 
+     *
      * @param clazz The Class whose name should be used as the Logger name. If null it will default to the calling
      *            class.
      * @return The Logger.
@@ -519,7 +486,7 @@ public class LogManager {
 
     /**
      * Returns a Logger using the fully qualified name of the Class as the Logger name.
-     * 
+     *
      * @param clazz The Class whose name should be used as the Logger name. If null it will default to the calling
      *            class.
      * @param messageFactory The message factory is used only when creating a logger, subsequent use does not change the
@@ -535,7 +502,7 @@ public class LogManager {
 
     /**
      * Returns a Logger with the name of the calling class.
-     * 
+     *
      * @param messageFactory The message factory is used only when creating a logger, subsequent use does not change the
      *            logger but will log a warning if mismatched.
      * @return The Logger for the calling class.
@@ -547,7 +514,7 @@ public class LogManager {
 
     /**
      * Returns a Logger using the fully qualified class name of the value as the Logger name.
-     * 
+     *
      * @param value The value whose class name should be used as the Logger name. If null the name of the calling class
      *            will be used as the logger name.
      * @return The Logger.
@@ -560,7 +527,7 @@ public class LogManager {
 
     /**
      * Returns a Logger using the fully qualified class name of the value as the Logger name.
-     * 
+     *
      * @param value The value whose class name should be used as the Logger name. If null the name of the calling class
      *            will be used as the logger name.
      * @param messageFactory The message factory is used only when creating a logger, subsequent use does not change the


[2/2] logging-log4j2 git commit: LOG4J2-124 change behaviour of no-param shutdown() method to mean shutdown(false), improve documentation

Posted by rp...@apache.org.
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 <rp...@apache.org>
Authored: Mon Jan 25 22:21:34 2016 +0900
Committer: rpopma <rp...@apache.org>
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) {