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-babel | |
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-babel')
-rw-r--r-- | components/aai-babel/requirements.yaml | 3 | ||||
-rw-r--r-- | components/aai-babel/resources/config/logback.xml | 85 | ||||
-rw-r--r-- | components/aai-babel/resources/fproxy/config/logback-spring.xml | 12 | ||||
-rw-r--r-- | components/aai-babel/resources/rproxy/config/logback-spring.xml | 12 | ||||
-rw-r--r-- | components/aai-babel/values.yaml | 26 |
5 files changed, 90 insertions, 48 deletions
diff --git a/components/aai-babel/requirements.yaml b/components/aai-babel/requirements.yaml index 8297688..5fcafdb 100644 --- a/components/aai-babel/requirements.yaml +++ b/components/aai-babel/requirements.yaml @@ -1,5 +1,6 @@ # Copyright © 2018 Amdocs, AT&T # Modifications Copyright © 2018 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. @@ -19,4 +20,4 @@ dependencies: # local reference to common chart, as it is # a part of this chart's package and will not # be published independently to a repo (at this point) - repository: '@local' + repository: '@local'
\ No newline at end of file diff --git a/components/aai-babel/resources/config/logback.xml b/components/aai-babel/resources/config/logback.xml index 878d8c0..b8e8ad0 100644 --- a/components/aai-babel/resources/config/logback.xml +++ b/components/aai-babel/resources/config/logback.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- # Copyright © 2018 Amdocs, Bell Canada, AT&T +# 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. @@ -19,7 +20,7 @@ <include resource="org/springframework/boot/logging/logback/base.xml" /> <property name="componentName" value="AAI-BAS" /> - <property name="logDirectory" value="/var/log/onap/${componentName}" /> + <property name="logDirectory" value="{{ .Values.log.logDir }}/${componentName}" /> <!-- default EELF log file names --> <property name="generalLogName" value="error" /> @@ -27,6 +28,13 @@ <property name="auditLogName" value="audit" /> <property name="debugLogName" value="debug" /> + <property name="p_tim" value="%d{"yyyy-MM-dd'T'HH:mm:ss.SSSXXX", UTC}"/> + <property name="p_lvl" value="%level"/> + <property name="p_log" value="%logger"/> + <property name="p_mdc" value="%replace(%replace(%mdc){'\t','\\\\t'}){'\n', '\\\\n'}"/> + <property name="p_mak" value="%replace(%replace(%marker){'\t', '\\\\t'}){'\n','\\\\n'}"/> + <property name="p_thr" value="%thread"/> + <property name="errorLogPattern" value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%mdc{RequestId}|%thread|%mdc{ServiceName}|%mdc{PartnerName}|%mdc{TargetEntity}|%mdc{TargetServiceName}|%.-5level|%logger|%mdc{ClassName}|%msg%n" /> @@ -36,6 +44,9 @@ <property name="metricsLogPattern" value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%mdc{BeginTimestamp}|%mdc{EndTimestamp}|%mdc{RequestId}|%mdc{ServiceInstanceId}|%thread|%mdc{ServerFQDN}|%mdc{ServiceName}|%mdc{PartnerName}|%mdc{TargetEntity}|%mdc{TargetServiceName}|%mdc{StatusCode}|%mdc{ResponseCode}|%mdc{ResponseDescription}|%logger|%.-5level|||%mdc{ElapsedTime}|%mdc{RemoteHost}|%mdc{ClientAddress}|%mdc{ClassName}|||%msg%n" /> + <!-- Console (human-readable) logging --> + <property name="consolePattern" value="{{ .Values.log.consolePattern.babel.config }}"/> + <!-- ============================================================================ --> <!-- EELF Appenders --> <!-- ============================================================================ --> @@ -131,64 +142,72 @@ <includeCallerData>false</includeCallerData> </appender> - <!-- ============================================================================ --> - <!-- Default / root appenders --> - <!-- This determines the logging level for 3rd party code --> - <!-- ============================================================================ --> - - <root level="INFO"> - <appender-ref ref="asyncEELF" /> - <appender-ref ref="asyncEELFDebug" /> -</root> + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> + <encoder> + <pattern>${consolePattern}</pattern> + </encoder> + </appender> <!-- ============================================================================ --> <!-- EELF loggers --> <!-- ============================================================================ --> <logger name="com.att.eelf" level="INFO" additivity="false"> - <appender-ref ref="asyncEELF" /> -</logger> + <appender-ref ref="asyncEELF" /> + </logger> <!-- The level of this logger determines the contents of the debug log --> <logger name="com.att.eelf.debug" level="INFO" additivity="false"> - <appender-ref ref="asyncEELFDebug" /> -</logger> + <appender-ref ref="asyncEELFDebug" /> + </logger> <logger name="com.att.eelf.audit" level="INFO" additivity="false"> - <appender-ref ref="asyncEELFAudit" /> -</logger> + <appender-ref ref="asyncEELFAudit" /> + </logger> <logger name="com.att.eelf.metrics" level="INFO" additivity="false"> - <appender-ref ref="asyncEELFMetrics" /> -</logger> + <appender-ref ref="asyncEELFMetrics" /> + </logger> <!-- ============================================================================ --> <!-- Non-EELF loggers --> <!-- ============================================================================ --> <!-- ATT packages including DMAAP message routing --> - <logger name="com.att" level="INFO" /> + <logger name="com.att" level="{{.Values.log.logger.att}}" /> <!-- 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.springframework" level="{{.Values.log.logger.springframework}}" /> + <logger name="org.springframework.beans" level="{{.Values.log.logger.springframeworkBeans}}" /> + <logger name="org.springframework.web" level="{{.Values.log.logger.springframeworkWeb}}" /> <!-- Other Loggers that may help troubleshoot --> - <logger name="org.apache" level="WARN" /> - <logger name="org.apache.commons" level="WARN" /> + <logger name="org.apache" level="{{.Values.log.logger.apache}}" /> + <logger name="org.apache.commons" level="{{.Values.log.logger.apacheCommons}}" /> <!-- Camel Related Loggers (including restlet/servlet/jaxrs/cxf logging. May aid in troubleshooting) --> - <logger name="org.apache.camel" level="WARN" /> - <logger name="org.apache.cxf" level="WARN" /> - <logger name="org.apache.camel.processor.interceptor" level="WARN" /> - <logger name="org.apache.cxf.jaxrs.interceptor" level="WARN" /> - <logger name="org.apache.cxf.service" level="WARN" /> - <logger name="org.restlet" level="WARN" /> - <logger name="org.apache.camel.component.restlet" level="WARN" /> + <logger name="org.apache.camel" level="{{.Values.log.logger.apacheCamel}}" /> + <logger name="org.apache.cxf" level="{{.Values.log.logger.apacheCxf}}" /> + <logger name="org.apache.camel.processor.interceptor" level="{{.Values.log.logger.apacheCamelProcessorInterceptor}}" /> + <logger name="org.apache.cxf.jaxrs.interceptor" level="{{.Values.log.logger.apacheCxfJaxrsInterceptor}}" /> + <logger name="org.apache.cxf.service" level="{{.Values.log.logger.apacheCxfService}}" /> + <logger name="org.apache.camel.component.restlet" level="{{.Values.log.logger.apacheCamelComponentRestlet}}" /> + + <logger name="org.restlet" level="{{.Values.log.logger.restlet}}" /> <!-- 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.log.logger.qosLogbackClassic}}" /> + <logger name="ch.qos.logback.core" level="{{.Values.log.logger.qosLogbackCore}}" /> + + <!-- ============================================================================ --> + <!-- Default / root appenders --> + <!-- This determines the logging level for 3rd party code --> + <!-- ============================================================================ --> + + <root level="{{ .Values.log.root.level }}"> + <appender-ref ref="asyncEELF" /> + <appender-ref ref="asyncEELFDebug" /> + <appender-ref ref="STDOUT" /> + </root> </configuration> diff --git a/components/aai-babel/resources/fproxy/config/logback-spring.xml b/components/aai-babel/resources/fproxy/config/logback-spring.xml index 0637cfb..aa37596 100644 --- a/components/aai-babel/resources/fproxy/config/logback-spring.xml +++ b/components/aai-babel/resources/fproxy/config/logback-spring.xml @@ -4,12 +4,10 @@ <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.babel.froxy }}</Pattern> </layout> </appender> @@ -34,12 +32,12 @@ </appender> <!-- LOG everything at INFO level --> - <root level="info"> + <root level="{{ .Values.log.root.level }}"> <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" /> + <logger name="org.onap.aaf.fproxy" level="INFO" /> </configuration>
\ No newline at end of file diff --git a/components/aai-babel/resources/rproxy/config/logback-spring.xml b/components/aai-babel/resources/rproxy/config/logback-spring.xml index 2cd95d4..368367d 100644 --- a/components/aai-babel/resources/rproxy/config/logback-spring.xml +++ b/components/aai-babel/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.babel.rproxy }}</Pattern> </layout> </appender> @@ -34,12 +32,12 @@ </appender> <!-- LOG everything at INFO level --> - <root level="info"> + <root level="{{ .Values.log.root.level }}"> <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" /> + <logger name="org.onap.aaf.rproxy" level="INFO" /> </configuration> diff --git a/components/aai-babel/values.yaml b/components/aai-babel/values.yaml index 6f2c033..d2eeb6c 100644 --- a/components/aai-babel/values.yaml +++ b/components/aai-babel/values.yaml @@ -68,6 +68,32 @@ ingress: config: ssl: "redirect" +log: + logDir: {{ .Values.log.logDir }} + root: + level: {{ .Values.log.root.level.babel }} + consolePattern: + babel: + config: {{ .Values.log.consolePattern.babel.config }} + froxy: {{ .Values.log.consolePattern.babel.froxy }} + rproxy: {{ .Values.log.consolePattern.babel.rproxy }} + logger: + apache: {{ .Values.log.logger.apache }} + apacheCamel: {{ .Values.log.logger.apacheCamel }} + apacheCamelComponentRestlet: {{ .Values.log.logger.apacheCamelComponentRestlet }} + apacheCamelProcessorInterceptor: {{ .Values.log.logger.apacheCamelProcessorInterceptor }} + apacheCommons: {{ .Values.log.logger.apacheCommons }} + apacheCxf: {{ .Values.log.logger.apacheCxf }} + apacheCxfJaxrsInterceptor: {{ .Values.log.logger.apacheCxfJaxrsInterceptor }} + apacheCxfService: {{ .Values.log.logger.apacheCxfService }} + att: {{ .Values.log.logger.att }} + qosLogbackClassic: {{ .Values.log.logger.qosLogbackClassic }} + qosLogbackCore: {{ .Values.log.logger.qosLogbackCore }} + restlet: {{ .Values.log.logger.restlet }} + springframework: {{ .Values.log.logger.springframework }} + springframeworkBeans: {{ .Values.log.logger.springframeworkBeans }} + springframeworkWeb: {{ .Values.log.logger.springframeworkWeb }} + resources: small: limits: |