cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r809746 - in /incubator/cassandra/trunk/src/java/org/apache/cassandra/service: StorageService.java StorageServiceMBean.java
Date Mon, 31 Aug 2009 21:14:28 GMT
Author: jbellis
Date: Mon Aug 31 21:14:27 2009
New Revision: 809746

URL: http://svn.apache.org/viewvc?rev=809746&view=rev
Log:
allow setting the logging level at runtime via mbean.
patch by jbellis; reviewed by Eric Evans for CASSANDRA-402

Modified:
    incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java?rev=809746&r1=809745&r2=809746&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java Mon
Aug 31 21:14:27 2009
@@ -44,6 +44,7 @@
 import org.apache.cassandra.utils.FileUtils;
 import org.apache.cassandra.utils.LogUtil;
 import org.apache.log4j.Logger;
+import org.apache.log4j.Level;
 
 /*
  * This abstraction contains the token/identifier of this node
@@ -1023,4 +1024,11 @@
 	{
 	    return tokenMetadata_.cloneTokenEndPointMap();
 	}
+
+    public void setLog4jLevel(String classQualifier, String rawLevel)
+    {
+        Level level = Level.toLevel(rawLevel);
+        Logger.getLogger(classQualifier).setLevel(level);
+        logger_.info("set log level to " + level + " for classes under '" + classQualifier
+ "' (if the level doesn't look like '" + rawLevel + "' then log4j couldn't parse '" + rawLevel
+ "')");
+    }
 }

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java?rev=809746&r1=809745&r2=809746&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java
(original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageServiceMBean.java
Mon Aug 31 21:14:27 2009
@@ -91,4 +91,7 @@
      * @throws IOException
      */
     public void forceTableFlushBinary(String tableName) throws IOException;
+
+    /** set the logging level at runtime */
+    public void setLog4jLevel(String classQualifier, String level);
 }



Mime
View raw message