summaryrefslogtreecommitdiffstats
path: root/aai-els-onap-logging/src/test/resources/logback.xml
blob: 2925be004413de78945d652e548003447b3a93ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<!--
 ============LICENSE_START=======================================================
 org.onap.aai
 ================================================================================
 Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
 ================================================================================
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 ============LICENSE_END=========================================================
-->
<configuration scan="true" scanPeriod="60 seconds" debug="false">
	<statusListener class="ch.qos.logback.core.status.NopStatusListener" />

	<property resource="application.properties" />

	<property name="namespace" value="aai-resources"/>

	<property name="AJSC_HOME" value="${AJSC_HOME:-.}" />
	<jmxConfigurator />
	<property name="logDirectory" value="${AJSC_HOME}/logs" />

	<property name="p_tim" value="%d{&quot;yyyy-MM-dd'T'HH:mm:ss.SSSXXX&quot;, UTC}"/>
	<property name="p_lvl" value="%level"/>
	<property name="p_log" value="%logger"/>
	<property name="p_mdc" value="%replace(%replace(%replace(%mdc){'\t','\\\\t'}){'\n', '\\\\n'}){'\\|', '!'}"/>
	<property name="p_msg" value="%replace(%replace(%msg){'\t', '\\\\t'}){'\n','\\\\n'}"/>
	<property name="p_exc" value="%replace(%replace(%rootException){'\t', '\\\\t'}){'\n','\\\\n'}"/>
	<property name="p_mak" value="%replace(%replace(%marker){'\t', '\\\\t'}){'\n','\\\\n'}"/>
	<property name="p_thr" value="%thread"/>
	<property name="pattern" value="%nopexception${p_tim}\t${p_thr}\t${p_lvl}\t${p_log}\t${p_mdc}\t${p_msg}\t${p_exc}\t${p_mak}\t%n"/>
	<!-- Patterns from onap demo -->
	<property name="errorPattern" value="%X{LogTimestamp}|%X{RequestID}|%thread|%replace(%X{ServiceName}){'\\|', '!'}|%X{PartnerName}|%X{TargetEntity}|%replace(%X{TargetServiceName}){'\\|', '!'}|%.-5level|%X{ErrorCode}|%X{ErrorDesc}|%msg%n" />
	<property name="debugPattern" value="%X{LogTimestamp}|%X{RequestID}|%msg\t${p_mdc}\t${p_msg}\t${p_exc}\t${p_mak}\t|^%n" />
	<property name="auditPattern" value="%X{EntryTimestamp}|%X{LogTimestamp}|%X{RequestID}|%X{ServiceInstanceID}|%thread||%replace(%X{ServiceName}){'\\|', '!'}|%X{PartnerName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDesc}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ElapsedTime}|%X{ServerFQDN}|%X{RemoteHost}||||${p_mak}|${p_mdc}|||%msg%n" />
	<property name="metricPattern" value="%X{InvokeTimestamp}|%X{LogTimestamp}|%X{RequestID}|%X{ServiceInstanceID}|%thread||%replace(%X{ServiceName}){'\\|', '!'}|%X{PartnerName}|%X{TargetEntity}|%replace(%X{TargetServiceName}){'\\|', '!'}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDesc}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ElapsedTime}|%X{ServerFQDN}|%X{RemoteHost}||||%X{TargetVirtualEntity}|${p_mak}|${p_mdc}|||%msg%n" />
	<property name="transLogPattern" value="%X{LogTimestamp}|%date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}|%X{RequestID}|%X{ServiceInstanceID}|%-10t|%X{ServerFQDN}|%X{ServiceName}|%X{PartnerName}|%X{StatusCode}|%X{ResponseCode}|%replace(%replace(%X{ResponseDesc}){'\\|', '!'}){'\r|\n', '^'}|%X{InstanceUUID}|%level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ElapsedTime}|%X{ServerFQDN}|%X{clientIpAddress}||%X{unused}|%X{processKey}|%X{customField1}|%X{customField2}|%X{customField3}|%X{customField4}|co=%X{PartnerName}:%m%n"/>
	<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
    <conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
    <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>
		</encoder>
	</appender>


	<appender name="asyncMETRIC" class="ch.qos.logback.classic.AsyncAppender">
		<queueSize>1000</queueSize>
		<includeCallerData>true</includeCallerData>
		<appender-ref ref="METRIC"/>
	</appender>

	<appender name="DEBUG"
			  class="ch.qos.logback.core.rolling.RollingFileAppender">
		<filter class="ch.qos.logback.classic.filter.LevelFilter">
			<level>DEBUG</level>
			<onMatch>ACCEPT</onMatch>
			<onMismatch>DENY</onMismatch>
		</filter>
		<file>${logDirectory}/debug.log</file>
		<rollingPolicy
				class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>${logDirectory}/debug.log.%d{yyyy-MM-dd}</fileNamePattern>
		</rollingPolicy>
		<encoder>
			<pattern>${debugPattern}</pattern>
		</encoder>
	</appender>

	<appender name="asyncDEBUG" class="ch.qos.logback.classic.AsyncAppender">
		<queueSize>1000</queueSize>
		<appender-ref ref="DEBUG" />
		<includeCallerData>true</includeCallerData>
	</appender>
	<appender name="ERROR"
			  class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${logDirectory}/error.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>${logDirectory}/error.log.%d{yyyy-MM-dd-HH-mm}
            </fileNamePattern>
            <maxHistory>1</maxHistory>
            <cleanHistoryOnStart>true</cleanHistoryOnStart>
        </rollingPolicy>

        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
			<level>WARN</level>
		</filter>
		<encoder>
			<pattern>${errorPattern}</pattern>
		</encoder>
	</appender>

	<appender name="asyncERROR" class="ch.qos.logback.classic.AsyncAppender">
		<queueSize>1000</queueSize>
		<appender-ref ref="ERROR"/>
	</appender>

	<appender name="AUDIT"
		class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${logDirectory}/audit.log</file>
		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>${logDirectory}/audit.log.%d{yyyy-MM-dd}
			</fileNamePattern>
		</rollingPolicy>
		<encoder>
			<pattern>${auditPattern}</pattern>
		</encoder>
	</appender>

	<appender name="asyncAUDIT" class="ch.qos.logback.classic.AsyncAppender">
		<queueSize>1000</queueSize>
		<includeCallerData>true</includeCallerData>
		<appender-ref ref="AUDIT" />
	</appender>

	<appender name="auth"
			  class="ch.qos.logback.core.rolling.RollingFileAppender">
		<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
			<level>DEBUG</level>
		</filter>
		<file>${logDirectory}/auth/auth.log</file>
		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<fileNamePattern>${logDirectory}/auth/auth.log.%d{yyyy-MM-dd}
			</fileNamePattern>
		</rollingPolicy>
		<encoder>
			<pattern>%d{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC}[%thread] %-5level %logger{1024} - %msg%n</pattern>
		</encoder>
	</appender>
	<appender name="asyncAUTH" class="ch.qos.logback.classic.AsyncAppender">
		<queueSize>1000</queueSize>
		<includeCallerData>true</includeCallerData>
		<appender-ref ref="auth" />
	</appender>
	<!-- logback internals logging -->

	<logger name="ch.qos.logback.classic" level="WARN" />
	<logger name="ch.qos.logback.core" level="WARN" />

	<logger name="com.jayway.jsonpath" level="WARN" />

	<logger name="org.apache" level="OFF" />

	<logger name="org.onap.aai" level="DEBUG" additivity="false">
		<appender-ref ref="STDOUT" />
	</logger>
	<logger name="org.onap.aai.logging.ErrorLogHelper" level="WARN">
		<appender-ref ref="asyncERROR"/>
	</logger>

	<root level="DEBUG">
		<appender-ref ref="STDOUT" />
	</root>
</configuration>