cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1162851 - in /cassandra/branches/cassandra-0.8: CHANGES.txt src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java src/java/org/apache/cassandra/thrift/CassandraDaemon.java
Date Mon, 29 Aug 2011 15:19:16 GMT
Author: jbellis
Date: Mon Aug 29 15:19:16 2011
New Revision: 1162851

URL: http://svn.apache.org/viewvc?rev=1162851&view=rev
Log:
fix log4j initialization in EmbeddedCassandraService
patch by jbellis; reviewed by tjake for CASSANDRA-2857

Modified:
    cassandra/branches/cassandra-0.8/CHANGES.txt
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/thrift/CassandraDaemon.java

Modified: cassandra/branches/cassandra-0.8/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/CHANGES.txt?rev=1162851&r1=1162850&r2=1162851&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.8/CHANGES.txt Mon Aug 29 15:19:16 2011
@@ -38,6 +38,8 @@
  * fix parsing of the Keyspace and ColumnFamily names in numeric
    and string representations in CLI (CASSANDRA-3075)
  * always hint counters (CASSANDRA-3099)
+ * fix log4j initialization in EmbeddedCassandraService (CASSANDRA-2857)
+
 
 0.8.4
  * include files-to-be-streamed in StreamInSession.getSources (CASSANDRA-2972)

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java?rev=1162851&r1=1162850&r2=1162851&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java
(original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java
Mon Aug 29 15:19:16 2011
@@ -62,17 +62,19 @@ import org.apache.cassandra.utils.Mx4jTo
  */
 public abstract class AbstractCassandraDaemon implements CassandraDaemon
 {
-    //Initialize logging in such a way that it checks for config changes every 10 seconds.
-    static
+    /**
+     * Initialize logging in such a way that it checks for config changes every 10 seconds.
+     */
+    public static void initLog4j()
     {
         String config = System.getProperty("log4j.configuration", "log4j-server.properties");
         URL configLocation = null;
-        try 
+        try
         {
             // try loading from a physical location first.
             configLocation = new URL(config);
         }
-        catch (MalformedURLException ex) 
+        catch (MalformedURLException ex)
         {
             // then try loading from the classpath.
             configLocation = AbstractCassandraDaemon.class.getClassLoader().getResource(config);

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/thrift/CassandraDaemon.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/thrift/CassandraDaemon.java?rev=1162851&r1=1162850&r2=1162851&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/thrift/CassandraDaemon.java
(original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/thrift/CassandraDaemon.java
Mon Aug 29 15:19:16 2011
@@ -26,6 +26,7 @@ import java.util.concurrent.ExecutorServ
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.cassandra.service.AbstractCassandraDaemon;
 import org.apache.thrift.server.TNonblockingServer;
 import org.apache.thrift.server.TThreadPoolServer;
 import org.slf4j.Logger;
@@ -53,6 +54,11 @@ import org.apache.thrift.transport.TTran
 
 public class CassandraDaemon extends org.apache.cassandra.service.AbstractCassandraDaemon
 {
+    static
+    {
+        AbstractCassandraDaemon.initLog4j();
+    }
+
     private static Logger logger = LoggerFactory.getLogger(CassandraDaemon.class);
     private final static String SYNC = "sync";
     private final static String ASYNC = "async";



Mime
View raw message