summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzhuguanyu <zhuguanyu5@huawei.com>2022-10-12 14:26:33 +0800
committerzhuguanyu <zhuguanyu5@huawei.com>2022-10-12 14:26:33 +0800
commit07bcac56bfeaca91657c8a080e42167fd29a52e3 (patch)
treef124d355928bab85eecc3f5df96db7e3726e8a5f
parent337b5ae680d3a1a37eba96b05a860f95dada7fe4 (diff)
Fix bugs for log configuration
Issue-ID: USECASEUI-716 Signed-off-by: zhuguanyu <zhuguanyu5@huawei.com> Change-Id: I248670a1fd565d82f33875ccf43d8578ca7250cc
-rw-r--r--intentanalysis/src/main/resources/logback.xml17
-rw-r--r--intentanalysis/src/test/resources/logback-test.xml17
2 files changed, 28 insertions, 6 deletions
diff --git a/intentanalysis/src/main/resources/logback.xml b/intentanalysis/src/main/resources/logback.xml
index 3198324..82a1954 100644
--- a/intentanalysis/src/main/resources/logback.xml
+++ b/intentanalysis/src/main/resources/logback.xml
@@ -22,6 +22,11 @@
</appender>
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
+ <!-- deny all events with a level below ERROR -->
+ <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+ <level>ERROR</level>
+ </filter>
+
<file>/var/log/usecaseui/intent-analysis/ERROR.log</file>
<append>true</append>
<!-- set immediateFlush to false for much higher logging throughput -->
@@ -30,7 +35,13 @@
<pattern>%d{yyyy-MM-dd HH:mm:ss:SSS} %5p ${PID} --- [%15.15t] %-40.40c{40} : %m%n</pattern>
</encoder>
</appender>
+
<appender name="ROLLING-FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <!-- deny all events with a level below DEBUG -->
+ <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+ <level>DEBUG</level>
+ </filter>
+
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>/var/log/usecaseui/intent-analysis/%d{yyyy-MM}-DEBUG.log</fileNamePattern>
<maxHistory>90</maxHistory>
@@ -41,15 +52,15 @@
</encoder>
</appender>
- <logger name="org.onap.usecaseui.intentanalysis" level="error">
+ <logger name="org.onap.usecaseui.intentanalysis" level="ERROR">
<appender-ref ref="FILE" />
</logger>
- <logger name="org.onap.usecaseui.intentanalysis" level="debug">
+ <logger name="org.onap.usecaseui.intentanalysis" level="DEBUG">
<appender-ref ref="ROLLING-FILE" />
</logger>
- <root level="info">
+ <root level="INFO">
<appender-ref ref="STDOUT"/>
</root>
diff --git a/intentanalysis/src/test/resources/logback-test.xml b/intentanalysis/src/test/resources/logback-test.xml
index cb9a4a4..ed1faf9 100644
--- a/intentanalysis/src/test/resources/logback-test.xml
+++ b/intentanalysis/src/test/resources/logback-test.xml
@@ -25,6 +25,11 @@
</appender>
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
+ <!-- deny all events with a level below ERROR -->
+ <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+ <level>ERROR</level>
+ </filter>
+
<file>${user.dir}/${LOG_HOME}/ERROR.log</file>
<append>true</append>
<!-- set immediateFlush to false for much higher logging throughput -->
@@ -33,7 +38,13 @@
<pattern>%d{yyyy-MM-dd HH:mm:ss:SSS} %5p ${PID} --- [%15.15t] %-40.40c{40} : %m%n</pattern>
</encoder>
</appender>
+
<appender name="ROLLING-FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <!-- deny all events with a level below DEBUG -->
+ <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+ <level>DEBUG</level>
+ </filter>
+
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${user.dir}/${LOG_HOME}/%d{yyyy-MM}-DEBUG.log</fileNamePattern>
<maxHistory>90</maxHistory>
@@ -44,15 +55,15 @@
</encoder>
</appender>
- <logger name="org.onap.usecaseui.intentanalysis" level="error">
+ <logger name="org.onap.usecaseui.intentanalysis" level="ERROR">
<appender-ref ref="FILE" />
</logger>
- <logger name="org.onap.usecaseui.intentanalysis" level="debug">
+ <logger name="org.onap.usecaseui.intentanalysis" level="DEBUG">
<appender-ref ref="ROLLING-FILE" />
</logger>
- <root level="info">
+ <root level="INFO">
<appender-ref ref="STDOUT"/>
</root>