brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [20/50] brooklyn-server git commit: Switch to rolling logs
Date Mon, 01 Feb 2016 17:49:24 GMT
Switch to rolling logs


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/76fadda5
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/76fadda5
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/76fadda5

Branch: refs/heads/0.6.0
Commit: 76fadda53ceb4f2e7a9d7dce4eff4e2df1aa5857
Parents: 69fd8d5
Author: Sam Corbett <sam.corbett@cloudsoftcorp.com>
Authored: Tue Nov 12 13:04:41 2013 +0000
Committer: Sam Corbett <sam.corbett@cloudsoftcorp.com>
Committed: Tue Nov 12 16:08:45 2013 +0000

----------------------------------------------------------------------
 .../brooklyn/logback-appender-file.xml          | 41 +++++++++++++++++++-
 .../brooklyn/logback-appender-file.xml          |  1 -
 2 files changed, 39 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/76fadda5/usage/logback-includes/src/main/resources/brooklyn/logback-appender-file.xml
----------------------------------------------------------------------
diff --git a/usage/logback-includes/src/main/resources/brooklyn/logback-appender-file.xml
b/usage/logback-includes/src/main/resources/brooklyn/logback-appender-file.xml
index 0a49cab..675ffaa 100644
--- a/usage/logback-includes/src/main/resources/brooklyn/logback-appender-file.xml
+++ b/usage/logback-includes/src/main/resources/brooklyn/logback-appender-file.xml
@@ -1,15 +1,52 @@
 <included>
 
-  <appender name="FILE" class="ch.qos.logback.core.FileAppender">
-    <file>${logging.dir:-./}${logging.basename:-brooklyn}.log</file>
+  <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+    <file>${logging.dir:-./}${logging.basename:-brooklyn}.debug.log</file>
     <append>true</append>
     <encoder>
       <pattern>%d %-5level %logger{30} [%thread{15}]: %msg%n</pattern>
     </encoder>
+
+    <!-- Truncate log at 100 MB, max history of 10 -->
+    <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+      <fileNamePattern>${logging.dir:-./}${logging.basename:-brooklyn}.debug-%i.log.zip</fileNamePattern>
+      <minIndex>1</minIndex>
+      <maxIndex>10</maxIndex>
+    </rollingPolicy>
+
+    <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+      <maxFileSize>100MB</maxFileSize>
+    </triggeringPolicy>
   </appender>
 
+  <!-- create a separate info log which will let us see a much longer history
+       (debug logs may hit their 10x 100MB limit much sooner!) -->
+  <appender name="INFO-FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+    <file>${logging.dir:-./}${logging.basename:-brooklyn}.info.log</file>
+    <append>true</append>
+    <encoder>
+      <pattern>%d %-5level %logger{30} [%thread{15}]: %msg%n</pattern>
+    </encoder>
+    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+        <level>INFO</level>
+    </filter>
+
+    <!-- Truncate log at 100 MB, max history of 10 -->
+    <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
+      <fileNamePattern>${logging.dir:-./}${logging.basename:-brooklyn}.info-%i.log.zip</fileNamePattern>
+      <minIndex>1</minIndex>
+      <maxIndex>10</maxIndex>
+    </rollingPolicy>
+
+    <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
+      <maxFileSize>100MB</maxFileSize>
+    </triggeringPolicy>
+  </appender>
+
+
   <root>
     <appender-ref ref="FILE" />
+    <appender-ref ref="INFO-FILE" />
   </root>
 
 </included>

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/76fadda5/utils/test-support/src/main/resources/brooklyn/logback-appender-file.xml
----------------------------------------------------------------------
diff --git a/utils/test-support/src/main/resources/brooklyn/logback-appender-file.xml b/utils/test-support/src/main/resources/brooklyn/logback-appender-file.xml
index 04b12d2..06b87cb 100644
--- a/utils/test-support/src/main/resources/brooklyn/logback-appender-file.xml
+++ b/utils/test-support/src/main/resources/brooklyn/logback-appender-file.xml
@@ -1,4 +1,3 @@
-
 <included>
 
   <appender name="FILE" class="ch.qos.logback.core.FileAppender">


Mime
View raw message