logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1522449 - in /logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core: ./ async/ config/ filter/ net/ssl/
Date Thu, 12 Sep 2013 05:32:18 GMT
Author: ggregory
Date: Thu Sep 12 05:32:17 2013
New Revision: 1522449

URL: http://svn.apache.org/r1522449
Log:
Move LOGGER declarations up class hierarchies to the top and avoid declaring LOGGERs in subclasses.
Positive side effect: Remove the static final LOGGER from the Appender interface; IMO interfaces
are for contracts, not constants.

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/Appender.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilter.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilterable.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/KeyStoreConfiguration.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/StoreConfiguration.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/TrustStoreConfiguration.java

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/Appender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/Appender.java?rev=1522449&r1=1522448&r2=1522449&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/Appender.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/Appender.java
Thu Sep 12 05:32:17 2013
@@ -18,20 +18,12 @@ package org.apache.logging.log4j.core;
 
 import java.io.Serializable;
 
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.status.StatusLogger;
-
 /**
  * Appends log events.
  */
 public interface Appender extends LifeCycle {
 
     /**
-     * Allow subclasses access to the status logger without creating another instance.
-     */
-    public static final Logger LOGGER = StatusLogger.getLogger();
-
-    /**
      * Log in <code>Appender</code> specific way. When appropriate,
      * Loggers will call the <code>doAppend</code> method of appender
      * implementations in order to log.

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java?rev=1522449&r1=1522448&r2=1522449&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java
Thu Sep 12 05:32:17 2013
@@ -67,7 +67,6 @@ import org.apache.logging.log4j.status.S
 @Plugin(name = "asyncLogger", category = "Core", printObject = true)
 public class AsyncLoggerConfig extends LoggerConfig {
 
-    private static final Logger LOGGER = StatusLogger.getLogger();
     private AsyncLoggerConfigHelper helper;
 
     /**

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java?rev=1522449&r1=1522448&r2=1522449&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java
Thu Sep 12 05:32:17 2013
@@ -29,7 +29,7 @@ import org.apache.logging.log4j.status.S
  */
 public final class Configurator {
 
-    private static final StatusLogger LOGGER = StatusLogger.getLogger();
+    protected static final StatusLogger LOGGER = StatusLogger.getLogger();
 
     private Configurator() {
     }

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java?rev=1522449&r1=1522448&r2=1522449&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
Thu Sep 12 05:32:17 2013
@@ -59,7 +59,7 @@ import java.util.concurrent.atomic.Atomi
 @Plugin(name = "logger", category = "Core", printObject = true)
 public class LoggerConfig extends AbstractFilterable {
 
-    private static final Logger LOGGER = StatusLogger.getLogger();
+    protected static final Logger LOGGER = StatusLogger.getLogger();
     private static final int MAX_RETRIES = 3;
     private static final long WAIT_TIME = 1000;
     private static LogEventFactory LOG_EVENT_FACTORY = null;

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilter.java?rev=1522449&r1=1522448&r2=1522449&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilter.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilter.java
Thu Sep 12 05:32:17 2013
@@ -32,6 +32,7 @@ import org.apache.logging.log4j.status.S
  *
  */
 public abstract class AbstractFilter implements Filter, LifeCycle {
+    
     /**
      * Allow subclasses access to the status logger without creating another instance.
      */

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilterable.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilterable.java?rev=1522449&r1=1522448&r2=1522449&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilterable.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilterable.java
Thu Sep 12 05:32:17 2013
@@ -18,15 +18,19 @@ package org.apache.logging.log4j.core.fi
 
 import java.util.Iterator;
 
+import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.core.Filter;
 import org.apache.logging.log4j.core.LifeCycle;
 import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.status.StatusLogger;
 
 /**
  * Enhances a Class by allowing it to contain Filters.
  */
 public abstract class AbstractFilterable implements Filterable {
 
+    protected static final Logger LOGGER = StatusLogger.getLogger();
+
     private volatile Filter filter;
 
     protected AbstractFilterable(final Filter filter) {

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/KeyStoreConfiguration.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/KeyStoreConfiguration.java?rev=1522449&r1=1522448&r2=1522449&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/KeyStoreConfiguration.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/KeyStoreConfiguration.java
Thu Sep 12 05:32:17 2013
@@ -34,7 +34,6 @@ import java.security.cert.CertificateExc
  */
 @Plugin(name = "keyStore", category = "Core", printObject = true)
 public class KeyStoreConfiguration extends StoreConfiguration {
-    private static final StatusLogger LOGGER = StatusLogger.getLogger();
     private KeyStore keyStore;
     private String keyStoreType;
 

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/StoreConfiguration.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/StoreConfiguration.java?rev=1522449&r1=1522448&r2=1522449&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/StoreConfiguration.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/StoreConfiguration.java
Thu Sep 12 05:32:17 2013
@@ -16,10 +16,14 @@
  */
 package org.apache.logging.log4j.core.net.ssl;
 
+import org.apache.logging.log4j.status.StatusLogger;
+
 /**
  *
  */
 public class StoreConfiguration {
+    protected static final StatusLogger LOGGER = StatusLogger.getLogger();
+
     private String location;
     private String password;
 

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/TrustStoreConfiguration.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/TrustStoreConfiguration.java?rev=1522449&r1=1522448&r2=1522449&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/TrustStoreConfiguration.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/TrustStoreConfiguration.java
Thu Sep 12 05:32:17 2013
@@ -32,7 +32,6 @@ import java.security.cert.CertificateExc
  */
 @Plugin(name = "trustStore", category = "Core", printObject = true)
 public class TrustStoreConfiguration extends StoreConfiguration {
-    private static final StatusLogger LOGGER = StatusLogger.getLogger();
     private KeyStore trustStore;
     private String trustStoreType;
 



Mime
View raw message