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/09/09 17:27:59 UTC

[05/21] logging-log4j2 git commit: Revert "Remove internal method that is @deprecated Use {@link #createLogger(boolean, Level, String, String, AppenderRef[], Property[], Configuration, Filter)}"

Revert "Remove internal method that is @deprecated Use {@link #createLogger(boolean, Level, String, String, AppenderRef[], Property[], Configuration, Filter)}"

This reverts commit facb281ba2f5f83903a7aedf385f83d7f9520561.


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

Branch: refs/heads/LOG4J2-1349-gcfree-threadcontext
Commit: 21581e28ee361316a8d02b099efc64da336b3e76
Parents: 99c0d01
Author: Gary Gregory <gg...@apache.org>
Authored: Thu Sep 8 11:50:35 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Thu Sep 8 11:50:35 2016 -0700

----------------------------------------------------------------------
 .../logging/log4j/core/config/LoggerConfig.java | 34 ++++++++++++++++++++
 1 file changed, 34 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/21581e28/log4j-core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
index eb8e671..12f8615 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
@@ -399,6 +399,40 @@ public class LoggerConfig extends AbstractFilterable {
     /**
      * Factory method to create a LoggerConfig.
      *
+     * @param additivity True if additive, false otherwise.
+     * @param level The Level to be associated with the Logger.
+     * @param loggerName The name of the Logger.
+     * @param includeLocation whether location should be passed downstream
+     * @param refs An array of Appender names.
+     * @param properties Properties to pass to the Logger.
+     * @param config The Configuration.
+     * @param filter A Filter.
+     * @return A new LoggerConfig.
+     * @deprecated Use {@link #createLogger(boolean, Level, String, String, AppenderRef[], Property[], Configuration, Filter)}
+     */
+    @Deprecated
+    public static LoggerConfig createLogger(final String additivity,
+            final Level level, @PluginAttribute("name") final String loggerName,
+            final String includeLocation,
+            final AppenderRef[] refs,
+            final Property[] properties, @PluginConfiguration final Configuration config,
+            final Filter filter) {
+        if (loggerName == null) {
+            LOGGER.error("Loggers cannot be configured without a name");
+            return null;
+        }
+
+        final List<AppenderRef> appenderRefs = Arrays.asList(refs);
+        final String name = loggerName.equals(ROOT) ? Strings.EMPTY : loggerName;
+        final boolean additive = Booleans.parseBoolean(additivity, true);
+
+        return new LoggerConfig(name, appenderRefs, filter, level, additive, properties, config,
+                includeLocation(includeLocation));
+    }
+
+    /**
+     * Factory method to create a LoggerConfig.
+     *
      * @param additivity true if additive, false otherwise.
      * @param level The Level to be associated with the Logger.
      * @param loggerName The name of the Logger.