iota-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tonyfaust...@apache.org
Subject [10/10] incubator-iota git commit: SiftingAppender can not be stopped. Rolling to back to log to just one file for now.
Date Wed, 28 Sep 2016 01:19:20 GMT
SiftingAppender can not be stopped. Rolling to back to log to just one file for now.


Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/9b619625
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/9b619625
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/9b619625

Branch: refs/heads/master
Commit: 9b619625d99fddc1593afa3278be735f681752e8
Parents: 9d1a4e1
Author: Barbara Gomes <barbaramaltagomes@gmail.com>
Authored: Wed Aug 24 16:07:51 2016 -0700
Committer: Barbara Gomes <barbaramaltagomes@gmail.com>
Committed: Wed Aug 24 16:07:51 2016 -0700

----------------------------------------------------------------------
 fey-core/src/main/resources/logback.xml         | 45 +++++++-------------
 .../scala/org/apache/iota/fey/Monitor.scala     | 10 ++---
 2 files changed, 21 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/9b619625/fey-core/src/main/resources/logback.xml
----------------------------------------------------------------------
diff --git a/fey-core/src/main/resources/logback.xml b/fey-core/src/main/resources/logback.xml
index 396832f..542ab89 100644
--- a/fey-core/src/main/resources/logback.xml
+++ b/fey-core/src/main/resources/logback.xml
@@ -28,36 +28,23 @@
         </encoder>
     </appender>
 
-    <appender name="FEY-FILE" class="ch.qos.logback.classic.sift.SiftingAppender">
-
-        <!-- MDC value -->
-        <discriminator>
-            <key>fileName</key>
-            <defaultValue>fey_core</defaultValue>
-        </discriminator>
-
-        <sift>
-            <!-- Fey core -->
-            <appender name="FEY-FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
-                <append>true</append>
-                <file>${LOG_HOME}/${fileName}.log</file>
-                <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
-                    <!-- daily rollover. Make sure the path matches the one in the file
element or else
-                     the rollover logs are placed in the working directory. -->
-                    <fileNamePattern>${LOG_HOME}/${fileName}-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
-                    <maxFileSize>1MB</maxFileSize>
-                    <maxHistory>30</maxHistory>
-                    <totalSizeCap>1GB</totalSizeCap>
-                </rollingPolicy>
-
-                <encoder>
-                    <charset>UTF-8</charset>
-                    <pattern>[%p] [%d{yy/MM/dd HH:mm:ss}] %c [%X{akkaSource}] : %msg%n</pattern>
-                </encoder>
-            </appender>
-
-        </sift>
+    <!-- Fey core -->
+    <appender name="FEY-FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <append>true</append>
+        <file>${LOG_HOME}/fey_core.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <!-- daily rollover. Make sure the path matches the one in the file element
or else
+             the rollover logs are placed in the working directory. -->
+            <fileNamePattern>${LOG_HOME}/fey_core-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
+            <maxFileSize>1MB</maxFileSize>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>1GB</totalSizeCap>
+        </rollingPolicy>
 
+        <encoder>
+            <charset>UTF-8</charset>
+            <pattern>[%p] [%d{yy/MM/dd HH:mm:ss}] %c [%X{akkaSource}] : %msg%n</pattern>
+        </encoder>
     </appender>
 
     <root level="INFO">

http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/9b619625/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala b/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala
index ded1c9f..2100cbd 100644
--- a/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala
+++ b/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala
@@ -17,7 +17,7 @@
 
 package org.apache.iota.fey
 
-import akka.actor.Actor
+import akka.actor.{Actor, ActorLogging}
 import akka.event.{DiagnosticLoggingAdapter, Logging}
 
 import scala.collection.mutable.ArrayBuffer
@@ -25,12 +25,12 @@ import scala.collection.mutable.ArrayBuffer
 /**
   * Created by barbaragomes on 7/8/16.
   */
-protected class Monitor(eventsStore: Trie) extends Actor {
+protected class Monitor(eventsStore: Trie) extends Actor with ActorLogging {
 
   import Monitor._
 
-  val log: DiagnosticLoggingAdapter = Logging(this)
-  log.mdc(Map("fileName" -> "monitor_events"))
+  //val log: DiagnosticLoggingAdapter = Logging(this)
+  //log.mdc(Map("fileName" -> "monitor_events"))
 
 
   override def preStart(): Unit = {
@@ -44,7 +44,7 @@ protected class Monitor(eventsStore: Trie) extends Actor {
   }
 
   override def postStop(): Unit = {
-    log.clearMDC()
+    //log.clearMDC()
   }
 
   private def complete: Receive = {


Mime
View raw message