cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdusba...@apache.org
Subject svn commit: r1053205 - in /cassandra/branches/cassandra-0.7: CHANGES.txt src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java
Date Mon, 27 Dec 2010 22:13:53 GMT
Author: gdusbabek
Date: Mon Dec 27 22:13:53 2010
New Revision: 1053205

URL: http://svn.apache.org/viewvc?rev=1053205&view=rev
Log:
log4j configuration wasn't handling configurations specified by URL. patch by Gary Dusbabek,
reviewed by Jake Luciani. CASSANDRA-1907

Modified:
    cassandra/branches/cassandra-0.7/CHANGES.txt
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java

Modified: cassandra/branches/cassandra-0.7/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/CHANGES.txt?rev=1053205&r1=1053204&r2=1053205&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.7/CHANGES.txt Mon Dec 27 22:13:53 2010
@@ -9,6 +9,7 @@ dev
  * avoid polluting page cache with commitlog or sstable writes
    and seq scan operations (CASSANDRA-1470)
  * add OpenBitSet to support larger bloom filters (CASSANDRA-1555)
+ * handle URL-specified log4j regression (CASSANDRA-1907)
 
 
 0.7.0-rc3

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java?rev=1053205&r1=1053204&r2=1053205&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/service/AbstractCassandraDaemon.java
Mon Dec 27 22:13:53 2010
@@ -21,6 +21,8 @@ package org.apache.cassandra.service;
 import java.io.File;
 import java.io.IOException;
 import java.net.InetAddress;
+import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.UUID;
 import java.util.concurrent.RejectedExecutionException;
 import java.util.concurrent.SynchronousQueue;
@@ -59,7 +61,20 @@ public abstract class AbstractCassandraD
     static
     {
         String config = System.getProperty("log4j.configuration", "log4j-server.properties");
-        PropertyConfigurator.configureAndWatch(ClassLoader.getSystemResource(config).getFile(),
10000);
+        URL configLocation = null;
+        try 
+        {
+            // try loading from a physical location first.
+            configLocation = new URL(config);
+        }
+        catch (MalformedURLException ex) 
+        {
+            // load from the classpath.
+            configLocation = AbstractCassandraDaemon.class.getClassLoader().getResource(config);
+            if (configLocation == null)
+                throw new RuntimeException("Couldn't figure out log4j configuration.");
+        }
+        PropertyConfigurator.configureAndWatch(configLocation.getFile(), 10000);
         org.apache.log4j.Logger.getLogger(AbstractCassandraDaemon.class).info("Logging initialized");
     }
 



Mime
View raw message