logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1385342 - in /logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j: BasicConfigurator.java LogManager.java
Date Sun, 16 Sep 2012 18:45:30 GMT
Author: rgoers
Date: Sun Sep 16 18:45:29 2012
New Revision: 1385342

URL: http://svn.apache.org/viewvc?rev=1385342&view=rev
Log:
Add BasicConfigurator

Added:
    logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/BasicConfigurator.java
Modified:
    logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/LogManager.java

Added: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/BasicConfigurator.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/BasicConfigurator.java?rev=1385342&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/BasicConfigurator.java
(added)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/BasicConfigurator.java
Sun Sep 16 18:45:29 2012
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.log4j;
+
+/**
+ * Provided for compatibility with Log4j 1.x
+ */
+public class BasicConfigurator {
+
+    protected BasicConfigurator() {
+    }
+
+    public static void configure() {
+        LogManager.reconfigure();
+    }
+
+    public static void resetConfiguration() {
+        LogManager.reconfigure();
+    }
+}

Modified: logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/LogManager.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/LogManager.java?rev=1385342&r1=1385341&r2=1385342&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/LogManager.java
(original)
+++ logging/log4j/log4j2/trunk/log4j12-api/src/main/java/org/apache/log4j/LogManager.java
Sun Sep 16 18:45:29 2012
@@ -46,6 +46,11 @@ public final class LogManager {
         return Logger.getLogger(name);
     }
 
+    static void reconfigure() {
+        LoggerContext ctx = (LoggerContext) PrivateManager.getContext();
+        ctx.reconfigure();
+    }
+
     /**
      * Internal LogManager.
      */



Mime
View raw message