aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/resources/uniquePropertyCheck-logback.xml
blob: b4522d5d51d241513cc093329fc9725aee57f3fc (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
<configuration>
	<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(%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"/>
	<property name="errorPattern" value="%X{LogTimestamp}|%X{RequestID}|%thread|%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%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||%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||%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%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"/>

	<appender name="uniquePropertyChecklog" class="ch.qos.logback.classic.sift.SiftingAppender">
		<filter class="ch.qos.logback.classic.filter.LevelFilter">
			<level>INFO</level>
			<onMatch>ACCEPT</onMatch>
			<onMismatch>DENY</onMismatch>
		</filter>
		<!-- This is MDC value -->
		<!-- We will assign a value to 'logFilenameAppender' via Java code -->
		<discriminator>
			<key>logFilenameAppender</key>
			<defaultValue>undefined</defaultValue>
		</discriminator>
		<sift>
			<!-- A standard RollingFileAppender, the log file is based on 'logFileName' 
				at runtime -->
			<appender name="FILE-${logFilenameAppender}"
				class="ch.qos.logback.core.rolling.RollingFileAppender">
				<file>${logDirectory}/uniquePropertyCheck/${logFilenameAppender}.log</file>
				<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
					<fileNamePattern>${logDirectory}/uniquePropertyCheck/${logFilenameAppender}.log.%d{yyyy-MM-dd}
					</fileNamePattern>
				</rollingPolicy>
				<encoder>
					<pattern>${auditPattern}</pattern>
				</encoder>
			</appender>
		</sift>
	</appender>

	<logger name="org.reflections" level="WARN" additivity="false">
		<appender-ref ref="uniquePropertyChecklog" />
	</logger>
	<logger name="org.apache.zookeeper" level="ERROR" additivity="false">
		<appender-ref ref="uniquePropertyChecklog" />
	</logger>
	<logger name="org.apache.hadoop" level="ERROR" additivity="false">
		<appender-ref ref="uniquePropertyChecklog" />
	</logger>
	<logger name="com.thinkaurelius" level="WARN" additivity="false">
		<appender-ref ref="uniquePropertyChecklog" />
	</logger>
	<logger name="ch.qos.logback.classic" level="WARN" additivity="false">
		<appender-ref ref="uniquePropertyChecklog" />
	</logger>
	<logger name="ch.qos.logback.core" level="WARN" additivity="false">
		<appender-ref ref="uniquePropertyChecklog" />
	</logger>
	<logger name="org.onap.aai" level="INFO" additivity="false">
		<appender-ref ref="uniquePropertyChecklog" />
	</logger>
	<logger name="org.onap.aai.util.UniquePropertyCheck" level="INFO" additivity="false">
		<appender-ref ref="uniquePropertyChecklog" />
	</logger>

	<root level="INFO">
		<appender-ref ref="uniquePropertyChecklog" />
	</root>
</configuration>