[tor-commits] [collector/master] task-19015 minor tweaks. added console appender, some test permissions

karsten at torproject.org karsten at torproject.org
Mon Jun 6 20:44:22 UTC 2016


commit b65b4ade06fb7592ffc8f0743a09bac8cc3c01cb
Author: iwakeh <iwakeh at torproject.org>
Date:   Fri Jun 3 21:24:25 2016 +0200

    task-19015 minor tweaks. added console appender, some test permissions
    for logback, and test error info.
---
 src/main/resources/logback.xml                       | 15 ++++++++++++++-
 src/test/java/org/torproject/collector/MainTest.java |  2 +-
 src/test/resources/junittest.policy                  |  3 +++
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml
index 1b78d58..9c9426d 100644
--- a/src/main/resources/logback.xml
+++ b/src/main/resources/logback.xml
@@ -15,6 +15,16 @@
   <property name="utc-date-pattern" value="%date{ISO8601, UTC}" />
 
   <!-- appender section -->
+  <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>${utc-date-pattern} %level %logger{20}:%line %msg%n</pattern>
+    </encoder>
+
+    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+      <level>WARN</level>
+    </filter>
+  </appender>
+
   <appender name="FILEALL" class="ch.qos.logback.core.rolling.RollingFileAppender">
     <file>${fileall-logname}.log</file>
     <encoder>
@@ -116,7 +126,10 @@
     <appender-ref ref="FILEUPDATEINDEX" />
   </logger>
 
-  <logger name="sun" level="ERROR" />
+  <logger name="org.torproject" >
+    <appender-ref ref="CONSOLE" />
+  </logger>
+
 
   <root level="ALL">
     <appender-ref ref="FILEALL" />
diff --git a/src/test/java/org/torproject/collector/MainTest.java b/src/test/java/org/torproject/collector/MainTest.java
index 9a19285..f83cab5 100644
--- a/src/test/java/org/torproject/collector/MainTest.java
+++ b/src/test/java/org/torproject/collector/MainTest.java
@@ -38,7 +38,7 @@ public class MainTest {
 
   @Test()
   public void testSmoke() throws Exception {
-    System.out.println("\n!!!!   Three SEVERE log messages are expected."
+    System.out.println("\n!!!!   Three ERROR log messages are expected."
         + "\nOne each from: ExitListDownloader, "
         + "TorperfDownloader, and CreateIndexJson.\n");
     File conf = tmpf.newFile("test.conf");
diff --git a/src/test/resources/junittest.policy b/src/test/resources/junittest.policy
index e6eb2ef..208a172 100644
--- a/src/test/resources/junittest.policy
+++ b/src/test/resources/junittest.policy
@@ -7,4 +7,7 @@ grant {
   permission java.lang.RuntimePermission "accessDeclaredMembers";
   permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
   permission java.lang.RuntimePermission "shutdownHooks";
+  permission java.lang.RuntimePermission "accessClassInPackage.sun.reflect";
+  permission java.lang.RuntimePermission "accessClassInPackage.sun.net.www.protocol.http";
+  permission java.lang.RuntimePermission "accessClassInPackage.sun.net.www.http";
 };





More information about the tor-commits mailing list