blob: 07919a97a250ee13e02e1a8f6599e834132cf387 [file] [log] [blame]
Sylvain Desbureaux47eb4d22020-12-10 12:15:27 +01001{{/*
Sylvain Desbureaux70070412020-11-09 21:58:48 +01002<!--
3
4 ============LICENSE_START=======================================================
5 org.onap.aai
6 ================================================================================
7 Copyright © 2017 AT&T Intellectual Property. All rights reserved.
8 Modifications Copyright © 2018 Amdocs, Bell Canada
9 ================================================================================
10 Licensed under the Apache License, Version 2.0 (the "License");
11 you may not use this file except in compliance with the License.
12 You may obtain a copy of the License at
13
14 http://www.apache.org/licenses/LICENSE-2.0
15
16 Unless required by applicable law or agreed to in writing, software
17 distributed under the License is distributed on an "AS IS" BASIS,
18 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License for the specific language governing permissions and
20 limitations under the License.
21 ============LICENSE_END=========================================================
22
23 ECOMP is a trademark and service mark of AT&T Intellectual Property.
24
25-->
Sylvain Desbureaux47eb4d22020-12-10 12:15:27 +010026*/}}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010027<configuration>
Sylvain Desbureauxb4e038d2020-12-15 12:00:26 +010028 <property name="AJSC_HOME" value="${AJSC_HOME:-.}" />
Rommel Pawarc03db782022-09-21 16:16:12 -070029
Fiete Ostkamp42de5462024-01-04 13:56:15 +010030 <property name="logToFileEnabled" value='{{.Values.accessLogback.logToFileEnabled}}' />
Rommel Pawarc03db782022-09-21 16:16:12 -070031 <property name="maxHistory" value='{{.Values.accessLogback.maxHistory}}' />
32 <property name="totalSizeCap" value='{{.Values.accessLogback.totalSizeCap}}' />
Fiete Ostkamp42de5462024-01-04 13:56:15 +010033 <property name="livenessAccessLogEnabled"
34 value='{{.Values.accessLogback.livenessAccessLogEnabled}}' />
35
Rommel Pawarc03db782022-09-21 16:16:12 -070036
37 <if condition='property("logToFileEnabled").contains("true")'>
38 <then>
39 <appender name="ACCESS"
Fiete Ostkamp42de5462024-01-04 13:56:15 +010040 class="ch.qos.logback.core.rolling.RollingFileAppender">
Rommel Pawarc03db782022-09-21 16:16:12 -070041 <file>${AJSC_HOME}/logs/ajsc-jetty/localhost_access.log</file>
42 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
43 <fileNamePattern>${AJSC_HOME}/logs/ajsc-jetty/localhost_access.log.%d{yyyy-MM-dd}.zip
44 </fileNamePattern>
45 <maxHistory>${maxHistory}</maxHistory>
46 <totalSizeCap>${totalSizeCap}</totalSizeCap>
47 </rollingPolicy>
48 <encoder class="org.onap.aai.logging.CustomLogPatternLayoutEncoder">
Fiete Ostkamp42de5462024-01-04 13:56:15 +010049 <Pattern>%a %u %z [%t] "%m %U%q" %s %b %y %i{X-TransactionId} %i{X-FromAppId}
50 %i{X-Forwarded-For} %i{X-AAI-SSL-Client-CN} %i{X-AAI-SSL-Client-OU}
51 %i{X-AAI-SSL-Client-O} %i{X-AAI-SSL-Client-L} %i{X-AAI-SSL-Client-ST}
52 %i{X-AAI-SSL-Client-C} %i{X-AAI-SSL-Client-NotBefore} %i{X-AAI-SSL-Client-NotAfter}
53 %i{X-AAI-SSL-Client-DN} %D</Pattern>
Rommel Pawarc03db782022-09-21 16:16:12 -070054 </encoder>
55 </appender>
Fiete Ostkamp42de5462024-01-04 13:56:15 +010056 <appender-ref ref="ACCESS" />
Rommel Pawarc03db782022-09-21 16:16:12 -070057 </then>
58 </if>
59
60 <appender name="STDOUTACCESS" class="ch.qos.logback.core.ConsoleAppender">
Sylvain Desbureauxb4e038d2020-12-15 12:00:26 +010061 <encoder class="org.onap.aai.logging.CustomLogPatternLayoutEncoder">
Fiete Ostkamp42de5462024-01-04 13:56:15 +010062 <Pattern>%a %u %z [%t] "%m %U%q" %s %b %y %i{X-TransactionId} %i{X-FromAppId}
63 %i{X-Forwarded-For} %i{X-AAI-SSL-Client-CN} %i{X-AAI-SSL-Client-OU} %i{X-AAI-SSL-Client-O}
64 %i{X-AAI-SSL-Client-L} %i{X-AAI-SSL-Client-ST} %i{X-AAI-SSL-Client-C}
65 %i{X-AAI-SSL-Client-NotBefore} %i{X-AAI-SSL-Client-NotAfter} %i{X-AAI-SSL-Client-DN} %D -
66 "logType": "access"</Pattern>
Sylvain Desbureauxb4e038d2020-12-15 12:00:26 +010067 </encoder>
Fiete Ostkamp42de5462024-01-04 13:56:15 +010068 <if condition='property("livenessAccessLogEnabled").contains("false")'>
69 <then>
70 <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
71 <evaluator class="ch.qos.logback.access.net.URLEvaluator">
72 <URL>/aai/util/echo</URL>
73 </evaluator>
74 <OnMismatch>NEUTRAL</OnMismatch>
75 <OnMatch>DENY</OnMatch>
76 </filter>
77 </then>
78 </if>
Sylvain Desbureauxb4e038d2020-12-15 12:00:26 +010079 </appender>
Rommel Pawarc03db782022-09-21 16:16:12 -070080
81 <appender-ref ref="STDOUTACCESS" />
82
Sylvain Desbureaux70070412020-11-09 21:58:48 +010083</configuration>
Sylvain Desbureaux47eb4d22020-12-10 12:15:27 +010084{{/*
Sylvain Desbureauxb4e038d2020-12-15 12:00:26 +010085<!--
Sylvain Desbureaux70070412020-11-09 21:58:48 +010086%a - Remote IP address
87%A - Local IP address
88%b - Bytes sent, excluding HTTP headers, or '-' if no bytes were sent
89%B - Bytes sent, excluding HTTP headers
90%h - Remote host name
91%H - Request protocol
92%l - Remote logical username from identd (always returns '-')
93%m - Request method
94%p - Local port
95%q - Query string (prepended with a '?' if it exists, otherwise an empty string
96%r - First line of the request
97%s - HTTP status code of the response
98%S - User session ID
99%t - Date and time, in Common Log Format format
100%u - Remote user that was authenticated
101%U - Requested URL path
102%v - Local server name
103%I - current request thread name (can compare later with stacktraces)
104
105%z - Custom pattern that parses the cert for the subject
106%y - Custom pattern determines rest or dme2
Sylvain Desbureauxb4e038d2020-12-15 12:00:26 +0100107-->
Fiete Ostkamp42de5462024-01-04 13:56:15 +0100108*/}}