diff options
author | Dominik Mizyn <d.mizyn@partner.samsung.com> | 2020-08-26 08:39:34 +0200 |
---|---|---|
committer | Dominik Mizyn <d.mizyn@samsung.com> | 2020-09-01 15:08:15 +0200 |
commit | befaa5500924f9ebda0b4bf65d8d6ab5a9f0745a (patch) | |
tree | 3877df9612488fef551ddada948aebb994e9d8e3 /components/aai-resources/resources | |
parent | 7e6e2bf385f85e85e008d06b2415290851fee2b7 (diff) |
[AAI] Add logs to STDOUT
This commit add STDOUT appender to root level logging.
Additionally, it approximates the logback.xml file to
ONAP Application Logging Specification v1.2
Issue-ID: OOM-2514
Signed-off-by: Dominik Mizyn <d.mizyn@partner.samsung.com>
Change-Id: Iee075bb1400fd2ab2afbc39bf87e93f269ebaf84
Diffstat (limited to 'components/aai-resources/resources')
3 files changed, 33 insertions, 38 deletions
diff --git a/components/aai-resources/resources/config/logback.xml b/components/aai-resources/resources/config/logback.xml index ba06414..f532b4f 100644 --- a/components/aai-resources/resources/config/logback.xml +++ b/components/aai-resources/resources/config/logback.xml @@ -5,6 +5,7 @@ ================================================================================ Copyright © 2017 AT&T Intellectual Property. All rights reserved. Modifications Copyright © 2018 Amdocs, Bell Canada + Modifications Copyright © 2020 Samsung Electronics ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -59,9 +60,7 @@ <conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" /> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> - <pattern> - %clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx} - </pattern> + <pattern>{{ .Values.log.consolePattern.config }}</pattern> </encoder> </appender> @@ -280,23 +279,23 @@ </appender> <!-- logback internals logging --> - <logger name="ch.qos.logback.classic" level="WARN" /> - <logger name="ch.qos.logback.core" level="WARN" /> + <logger name="ch.qos.logback.classic" level="{{.Values.logback.loggger.qosLogbackClassic}}" /> + <logger name="ch.qos.logback.core" level="{{.Values.logback.loggger.qosLogbackCore}}" /> - <logger name="com.att.aft.dme2" level="WARN" /> - <logger name="com.jayway.jsonpath" level="WARN" /> + <logger name="com.att.aft.dme2" level="{{.Values.logback.loggger.attAftDme2}}" /> + <logger name="com.jayway.jsonpath" level="{{.Values.logback.loggger.jaywayJsonpath}}" /> - <logger name="org.apache" level="OFF" /> - <logger name="org.apache.commons" level="WARN" /> - <logger name="org.apache.zookeeper" level="OFF" /> - <logger name="org.codehaus.groovy" level="WARN" /> - <logger name="org.eclipse.jetty" level="WARN" /> + <logger name="org.apache" level="{{.Values.logback.loggger.apache}}" /> + <logger name="org.apache.commons" level="{{.Values.logback.loggger.apacheCommons}}" /> + <logger name="org.apache.zookeeper" level="{{.Values.logback.loggger.apacheZookeeper}}" /> + <logger name="org.codehaus.groovy" level="{{.Values.logback.loggger.codehausGroovy}}" /> + <logger name="org.eclipse.jetty" level="{{.Values.logback.loggger.eclipseJetty}}" /> <!-- Spring related loggers --> - <logger name="org.springframework" level="WARN" /> - <logger name="org.springframework.beans" level="WARN" /> - <logger name="org.springframework.web" level="WARN" /> - <logger name="org.janusgraph" level="WARN" /> - <logger name="org.zookeeper" level="OFF" /> + <logger name="org.springframework" level="{{.Values.logback.loggger.springframework}}" /> + <logger name="org.springframework.beans" level="{{.Values.logback.loggger.springframeworkBeans}}" /> + <logger name="org.springframework.web" level="{{.Values.logback.loggger.springframeworkWeb}}" /> + <logger name="org.janusgraph" level="{{.Values.logback.loggger.janusgraph}}" /> + <logger name="org.zookeeper" level="{{.Values.logback.loggger.zookeeper}}" /> <logger name="org.onap.aai" level="DEBUG" additivity="false"> @@ -335,7 +334,7 @@ <appender-ref ref="dmaapAAIEventConsumerInfo" /> </logger> - <root level="DEBUG"> + <root level="{{.Values.logback.rootLogLevel.config}}"> <appender-ref ref="external" /> <appender-ref ref="STDOUT" /> </root> diff --git a/components/aai-resources/resources/fproxy/config/logback-spring.xml b/components/aai-resources/resources/fproxy/config/logback-spring.xml index 9a08348..6d24a23 100644 --- a/components/aai-resources/resources/fproxy/config/logback-spring.xml +++ b/components/aai-resources/resources/fproxy/config/logback-spring.xml @@ -3,16 +3,14 @@ <property name="LOGS" value="./logs/AAF-FPS" /> <property name="FILEPREFIX" value="application" /> - - <appender name="Console" + + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <layout class="ch.qos.logback.classic.PatternLayout"> - <Pattern> - %d{ISO8601} %-5level [%t] %C{1.}: %msg%n%throwable - </Pattern> + <Pattern>{{ .Values.log.consolePattern.fproxy }}</Pattern> </layout> </appender> - + <appender name="RollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${LOGS}/${FILEPREFIX}.log</file> @@ -32,14 +30,14 @@ </timeBasedFileNamingAndTriggeringPolicy> </rollingPolicy> </appender> - + <!-- LOG everything at INFO level --> - <root level="info"> + <root level="{{.Values.logback.rootLogLevel.fproxy}}"> <appender-ref ref="RollingFile" /> - <appender-ref ref="Console" /> + <appender-ref ref="STDOUT" /> </root> - + <!-- LOG "com.baeldung*" at TRACE level --> <logger name="org.onap.aaf.fproxy" level="info" /> - + </configuration>
\ No newline at end of file diff --git a/components/aai-resources/resources/rproxy/config/logback-spring.xml b/components/aai-resources/resources/rproxy/config/logback-spring.xml index 799fd86..c0c506a 100644 --- a/components/aai-resources/resources/rproxy/config/logback-spring.xml +++ b/components/aai-resources/resources/rproxy/config/logback-spring.xml @@ -4,12 +4,10 @@ <property name="LOGS" value="./logs/reverse-proxy" /> <property name="FILEPREFIX" value="application" /> - <appender name="Console" + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <layout class="ch.qos.logback.classic.PatternLayout"> - <Pattern> - %d{ISO8601} %-5level [%t] %C{1.}: %msg%n%throwable - </Pattern> + <Pattern>{{ .Values.log.consolePattern.rproxy }}</Pattern> </layout> </appender> @@ -32,14 +30,14 @@ </timeBasedFileNamingAndTriggeringPolicy> </rollingPolicy> </appender> - + <!-- LOG everything at INFO level --> - <root level="info"> + <root level="{{.Values.logback.rootLogLevelrproxy}}"> <appender-ref ref="RollingFile" /> - <appender-ref ref="Console" /> + <appender-ref ref="STDOUT" /> </root> - + <!-- LOG "com.baeldung*" at TRACE level --> <logger name="org.onap.aaf.rproxy" level="info" /> - + </configuration> |