Add slf4j SimpleLogger properties file for unit tests 81/15181/2
authortpantelis <tpanteli@brocade.com>
Tue, 10 Feb 2015 05:37:12 +0000 (00:37 -0500)
committertpantelis <tpanteli@brocade.com>
Tue, 10 Feb 2015 14:08:22 +0000 (09:08 -0500)
Added a simplelogger.properties to sal-distributed-datastore and
sal-akka-raft to configure the logging format and to enable trace logging
for the appropriate pacakges.

Change-Id: I08909ad515eae1a782077d8be85d4337fbe0259d
Signed-off-by: tpantelis <tpanteli@brocade.com>
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/LeaderTest.java
opendaylight/md-sal/sal-akka-raft/src/test/resources/simplelogger.properties [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/test/resources/simplelogger.properties [new file with mode: 0644]

index 3f551b3a30efbf4c9b9e47108c35a75f06a57d0e..8251c6b265bd5ca85e247119104b4e6b268be9f6 100644 (file)
@@ -44,16 +44,10 @@ import org.opendaylight.controller.cluster.raft.messages.RequestVoteReply;
 import org.opendaylight.controller.cluster.raft.utils.DoNothingActor;
 import org.opendaylight.controller.cluster.raft.utils.MessageCollectorActor;
 import org.opendaylight.controller.protobuff.messages.cluster.raft.InstallSnapshotMessages;
-import org.slf4j.impl.SimpleLogger;
 import scala.concurrent.duration.FiniteDuration;
 
 public class LeaderTest extends AbstractRaftActorBehaviorTest {
 
-    static {
-        // This enables trace logging for the tests.
-        System.setProperty(SimpleLogger.LOG_KEY_PREFIX + MockRaftActorContext.class.getName(), "trace");
-    }
-
     private final ActorRef leaderActor =
         getSystem().actorOf(Props.create(DoNothingActor.class));
     private final ActorRef senderActor =
diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/resources/simplelogger.properties b/opendaylight/md-sal/sal-akka-raft/src/test/resources/simplelogger.properties
new file mode 100644 (file)
index 0000000..4e79807
--- /dev/null
@@ -0,0 +1,6 @@
+org.slf4j.simpleLogger.showDateTime=true
+org.slf4j.simpleLogger.dateTimeFormat=hh:mm:ss,S a
+org.slf4j.simpleLogger.logFile=System.out
+org.slf4j.simpleLogger.showShortLogName=true
+org.slf4j.simpleLogger.levelInBrackets=true
+org.slf4j.simpleLogger.org.opendaylight.controller.cluster.raft=trace
\ No newline at end of file
diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/resources/simplelogger.properties b/opendaylight/md-sal/sal-distributed-datastore/src/test/resources/simplelogger.properties
new file mode 100644 (file)
index 0000000..9ed3d27
--- /dev/null
@@ -0,0 +1,6 @@
+org.slf4j.simpleLogger.showDateTime=true
+org.slf4j.simpleLogger.dateTimeFormat=hh:mm:ss,S a
+org.slf4j.simpleLogger.logFile=System.out
+org.slf4j.simpleLogger.showShortLogName=true
+org.slf4j.simpleLogger.levelInBrackets=true
+org.slf4j.simpleLogger.log.org.opendaylight.controller.cluster.datastore=trace
\ No newline at end of file