You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hx...@apache.org on 2019/04/12 12:28:08 UTC

[incubator-iotdb] branch master updated: add a log appender: put info, warn, error log into one file; disable log_info by default (#147)

This is an automated email from the ASF dual-hosted git repository.

hxd pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 3702c4c  add a log appender: put info, warn, error log into one file; disable log_info by default (#147)
3702c4c is described below

commit 3702c4cf7162ef3615ba17814c208c36963da995
Author: Xiangdong Huang <hx...@qq.com>
AuthorDate: Fri Apr 12 20:28:04 2019 +0800

    add a log appender: put info, warn, error log into one file; disable log_info by default (#147)
    
    * add a log appender: put info, ware, error log into one file; disable the log_info file
---
 iotdb/iotdb/conf/logback.xml | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/iotdb/iotdb/conf/logback.xml b/iotdb/iotdb/conf/logback.xml
index 93cb742..1f8a915 100644
--- a/iotdb/iotdb/conf/logback.xml
+++ b/iotdb/iotdb/conf/logback.xml
@@ -111,11 +111,31 @@
     </appender>
     <logger level="info" name="org.apache.iotdb.db.service"/>
     <logger level="info" name="org.apache.iotdb.db.conf"/>
+
+    <!-- a log appender that collect all log records whose level is greather than debug-->
+    <appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="FILEALL">
+        <file>${IOTDB_HOME}/logs/log_all.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>${IOTDB_HOME}/logs/log-all-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>200MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <append>true</append>
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <pattern>%d [%t] %-5p %C:%L - %m %n</pattern>
+            <charset>utf-8</charset>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+            <level>INFO</level>
+        </filter>
+    </appender>
+
     <root level="info">
         <appender-ref ref="FILEDEBUG"/>
-        <appender-ref ref="FILEINFO"/>
         <appender-ref ref="FILEWARN"/>
         <appender-ref ref="FILEERROR"/>
+        <appender-ref ref="FILEALL"/>
         <appender-ref ref="stdout"/>
     </root>
 </configuration>