logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1490145 - /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/SocketServer.java
Date Thu, 06 Jun 2013 05:16:18 GMT
Author: ggregory
Date: Thu Jun  6 05:16:18 2013
New Revision: 1490145

URL: http://svn.apache.org/r1490145
Log:
Clean up logging initialization and use a per-instance logger that uses the port number as
the last part of its hierarchical name.

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/SocketServer.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/SocketServer.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/SocketServer.java?rev=1490145&r1=1490144&r2=1490145&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/SocketServer.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/net/SocketServer.java
Thu Jun  6 05:16:18 2013
@@ -48,7 +48,7 @@ import java.util.concurrent.ConcurrentMa
  */
 public class SocketServer extends AbstractServer implements Runnable {
 
-    private static Logger logger;
+    private final Logger logger;
 
     private static final int MAX_PORT = 65534;
 
@@ -64,11 +64,8 @@ public class SocketServer extends Abstra
      * @throws IOException If an error occurs.
      */
     public SocketServer(final int port) throws IOException {
-        server = new ServerSocket(port);
-        if (logger == null) {
-            logger = LogManager.getLogger(this);
-            // logger = LogManager.getLogger(getClass().getName() + '.' + port);
-        }
+        this.server = new ServerSocket(port);
+        this.logger = LogManager.getLogger(this.getClass().getName() + '.' + port);
     }
      /**
      * Main startup for the server.
@@ -90,7 +87,6 @@ public class SocketServer extends Abstra
         if (args.length == 2 && args[1].length() > 0) {
             ConfigurationFactory.setConfigurationFactory(new ServerConfigurationFactory(args[1]));
         }
-        logger = LogManager.getLogger(SocketServer.class.getName());
         final SocketServer sserver = new SocketServer(port);
         final Thread server = new Thread(sserver);
         server.start();



Mime
View raw message