[AAI] OOM AAI traversal logging structure enhancement
[oom.git] / kubernetes / aai / components / aai-traversal / resources / config / localhost-access-logback.xml
index 7f6a031..1d32a52 100644 (file)
@@ -1,17 +1,16 @@
-{{/*\r
-<!--\r
-\r
+{{/*<!--\r
     ============LICENSE_START=======================================================\r
     org.onap.aai\r
     ================================================================================\r
     Copyright © 2017 AT&T Intellectual Property. All rights reserved.\r
     Modifications Copyright © 2018 Amdocs, Bell Canada\r
+    Modifications Copyright © 2020 Orange\r
     ================================================================================\r
     Licensed under the Apache License, Version 2.0 (the "License");\r
     you may not use this file except in compliance with the License.\r
     You may obtain a copy of the License at\r
 \r
-       http://www.apache.org/licenses/LICENSE-2.0\r
+        http://www.apache.org/licenses/LICENSE-2.0\r
 \r
     Unless required by applicable law or agreed to in writing, software\r
     distributed under the License is distributed on an "AS IS" BASIS,\r
     See the License for the specific language governing permissions and\r
     limitations under the License.\r
     ============LICENSE_END=========================================================\r
-\r
-    ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
-\r
 -->\r
 */}}\r
-<configuration>\r
-       <property name="AJSC_HOME" value="${AJSC_HOME:-.}" />\r
-       <appender name="ACCESS"\r
-               class="ch.qos.logback.core.rolling.RollingFileAppender">\r
-               <file>${AJSC_HOME}/logs/ajsc-jetty/localhost_access.log</file>\r
-               <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">\r
-                       <fileNamePattern>${AJSC_HOME}/logs/ajsc-jetty/localhost_access.log.%d{yyyy-MM-dd}\r
-                       </fileNamePattern>\r
-               </rollingPolicy>\r
-               <encoder class="org.onap.aai.logging.CustomLogPatternLayoutEncoder">\r
-                       <Pattern>%a %u %z [%t] "%m %U%q" %s %b %y %i{X-TransactionId} %i{X-FromAppId} %i{X-Forwarded-For} %i{X-AAI-SSL-Client-CN} %i{X-AAI-SSL-Client-OU} %i{X-AAI-SSL-Client-O} %i{X-AAI-SSL-Client-L} %i{X-AAI-SSL-Client-ST} %i{X-AAI-SSL-Client-C} %i{X-AAI-SSL-Client-NotBefore} %i{X-AAI-SSL-Client-NotAfter} %i{X-AAI-SSL-Client-DN} %D</Pattern>\r
-               </encoder>\r
-       </appender>\r
-       <appender-ref ref="ACCESS" />\r
+<configuration scan="true" scanPeriod="60 seconds" debug="false">\r
+    <property name="AJSC_HOME" value="${AJSC_HOME:-.}" />\r
+    <property name="maxHistory" value='{{.Values.accessLogback.maxHistory}}' />\r
+    <property name="totalSizeCap" value='{{.Values.accessLogback.totalSizeCap}}' />\r
+    <property name="logToFileEnabled" value='{{.Values.accessLogback.logToFileEnabled}}'/>\r
+\r
+    <if condition='property("logToFileEnabled").contains("true")'>\r
+        <then>\r
+            <appender name="ACCESS" class="ch.qos.logback.core.rolling.RollingFileAppender">\r
+                <file>${AJSC_HOME}/logs/ajsc-jetty/localhost_access.log</file>\r
+                <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">\r
+                    <fileNamePattern>${AJSC_HOME}/logs/ajsc-jetty/localhost_access.log.%d{yyyy-MM-dd}\r
+                    </fileNamePattern>\r
+                    <maxHistory>${maxHistory}</maxHistory>\r
+                    <totalSizeCap>${totalSizeCap}</totalSizeCap>\r
+                </rollingPolicy>\r
+                <encoder class="org.onap.aai.logging.CustomLogPatternLayoutEncoder">\r
+                    <Pattern>%a %u %z [%t] "%m %U%q" %s %b %y %i{X-TransactionId} %i{X-FromAppId} %i{X-Forwarded-For} %i{X-AAI-SSL-Client-CN} %i{X-AAI-SSL-Client-OU} %i{X-AAI-SSL-Client-O} %i{X-AAI-SSL-Client-L} %i{X-AAI-SSL-Client-ST} %i{X-AAI-SSL-Client-C} %i{X-AAI-SSL-Client-NotBefore} %i{X-AAI-SSL-Client-NotAfter} %i{X-AAI-SSL-Client-DN} %D</Pattern>\r
+                </encoder>\r
+            </appender>\r
+            <appender-ref ref="ACCESS" />\r
+        </then>\r
+    </if>\r
+\r
+    <appender name="STDOUTACCESS" class="ch.qos.logback.core.ConsoleAppender">\r
+        <encoder class="org.onap.aai.logging.CustomLogPatternLayoutEncoder">\r
+            <Pattern>%a %u %z [%t] "%m %U%q" %s %b %y %i{X-TransactionId} %i{X-FromAppId} %i{X-Forwarded-For} %i{X-AAI-SSL-Client-CN} %i{X-AAI-SSL-Client-OU} %i{X-AAI-SSL-Client-O} %i{X-AAI-SSL-Client-L} %i{X-AAI-SSL-Client-ST} %i{X-AAI-SSL-Client-C} %i{X-AAI-SSL-Client-NotBefore} %i{X-AAI-SSL-Client-NotAfter} %i{X-AAI-SSL-Client-DN} %D - "logType": "access"</Pattern>\r
+        </encoder>\r
+    </appender>\r
+    <appender-ref ref="STDOUTACCESS" />\r
 </configuration>\r
-{{/*\r
-<!-- \r
+{{/*<!--\r
 %a - Remote IP address\r
 %A - Local IP address\r
 %b - Bytes sent, excluding HTTP headers, or '-' if no bytes were sent\r
@@ -62,5 +73,4 @@
 \r
 %z - Custom pattern that parses the cert for the subject\r
 %y - Custom pattern determines rest or dme2\r
- -->\r
-*/}}
\ No newline at end of file
+-->*/}}
\ No newline at end of file