blob: 25a2c6e093ab55745e203767872ee7779e9426b2 [file] [log] [blame]
econwar378cf192019-01-08 16:19:59 +00001<!--
2 ============LICENSE_START=======================================================
3 Copyright (C) 2019 Nordix Foundation.
4 ================================================================================
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16
17 SPDX-License-Identifier: Apache-2.0
18 ============LICENSE_END=========================================================
19-->
20<configuration scan="true" scanPeriod="3 seconds" debug="true">
21
22 <property name="generalLogName" value="apicalls" />
23 <property name="errorLogName" value="errors" />
24 <property name="jettyAndNodeLogName" value="node"/>
25
26 <property name="defaultPattern" value="%d{MM/dd-HH:mm:ss.SSS}|%logger|%X{RequestId}|%X{ServiceInstanceId}|%thread|%X{ServiceName}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|%msg%n" />
27 <property name="jettyAndNodeLoggerPattern" value="%d{MM/dd-HH:mm:ss.SSS}|%logger|%thread|%.-5level|%msg%n" />
28 <property name="debugLoggerPattern" value="%d{MM/dd-HH:mm:ss.SSS}|%X{RequestId}|%X{ServiceInstanceId}|%thread|%X{ServiceName}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}|%X{Timer}|[%caller{3}]|%msg%n" />
29
30 <property name="logDirectory" value="/opt/app/datartr/logs" />
31
32 <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
33 <encoder>
34 <pattern>${defaultPattern}</pattern>
35 </encoder>
36 </appender>
37
38 <!-- ============================================================================ -->
39 <!-- EELF Appenders -->
40 <!-- ============================================================================ -->
41
42 <appender name="EELF"
43 class="ch.qos.logback.core.rolling.RollingFileAppender">
44 <file>${logDirectory}/${generalLogName}.log</file>
45 <filter class="ch.qos.logback.classic.filter.LevelFilter">
46 <level>INFO</level>
47 <onMatch>ACCEPT</onMatch>
48 <onMismatch>DENY</onMismatch>
49 </filter>
50 <rollingPolicy
51 class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
52 <fileNamePattern>${logDirectory}/${generalLogName}.%i.log.zip
53 </fileNamePattern>
54 <minIndex>1</minIndex>
55 <maxIndex>9</maxIndex>
56 </rollingPolicy>
57 <triggeringPolicy
58 class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
59 <maxFileSize>5MB</maxFileSize>
60 </triggeringPolicy>
61 <encoder>
62 <pattern>${defaultPattern}</pattern>
63 </encoder>
64 </appender>
65
66 <appender name="asyncEELF" class="ch.qos.logback.classic.AsyncAppender">
67 <queueSize>256</queueSize>
68 <appender-ref ref="EELF" />
69 </appender>
70
71 <appender name="EELFError"
72 class="ch.qos.logback.core.rolling.RollingFileAppender">
73 <file>${logDirectory}/${errorLogName}.log</file>
74 <filter class="ch.qos.logback.classic.filter.LevelFilter">
75 <level>ERROR</level>
76 <onMatch>ACCEPT</onMatch>
77 <onMismatch>DENY</onMismatch>
78 </filter>
79 <rollingPolicy
80 class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
81 <fileNamePattern>${logDirectory}/${errorLogName}.%i.log.zip
82 </fileNamePattern>
83 <minIndex>1</minIndex>
84 <maxIndex>9</maxIndex>
85 </rollingPolicy>
86 <triggeringPolicy
87 class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
88 <maxFileSize>5MB</maxFileSize>
89 </triggeringPolicy>
90 <encoder>
91 <pattern>${defaultPattern}</pattern>
92 </encoder>
93 </appender>
94
95 <appender name="asyncEELFError" class="ch.qos.logback.classic.AsyncAppender">
96 <queueSize>256</queueSize>
97 <appender-ref ref="EELFError"/>
98 </appender>
99
100 <!-- ============================================================================ -->
101 <appender name="jettyAndNodelog"
102 class="ch.qos.logback.core.rolling.RollingFileAppender">
103 <file>${logDirectory}/${jettyAndNodeLogName}.log</file>
104 <filter class="org.onap.dmaap.datarouter.node.eelf.EELFFilter" />
105 <rollingPolicy
106 class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
107 <fileNamePattern>${logDirectory}/${jettyAndNodeLogName}.%i.log.zip
108 </fileNamePattern>
109 <minIndex>1</minIndex>
110 <maxIndex>9</maxIndex>
111 </rollingPolicy>
112 <triggeringPolicy
113 class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
114 <maxFileSize>5MB</maxFileSize>
115 </triggeringPolicy>
116 <encoder>
117 <pattern>${jettyAndNodeLoggerPattern}</pattern>
118 </encoder>
119 </appender>
120
121 <appender name="asyncEELFjettyAndNodelog" class="ch.qos.logback.classic.AsyncAppender">
122 <queueSize>256</queueSize>
123 <appender-ref ref="jettyAndNodelog" />
124 <includeCallerData>true</includeCallerData>
125 </appender>
126
127 <!-- ============================================================================ -->
128 <!-- EELF loggers -->
129 <!-- ============================================================================ -->
130 <logger name="com.att.eelf" level="info" additivity="false">
131 <appender-ref ref="asyncEELF" />
132 </logger>
133
134 <logger name="com.att.eelf.error" level="error" additivity="false">
135 <appender-ref ref="asyncEELFError" />
136 </logger>
137
138 <logger name="log4j.logger.org.eclipse.jetty" additivity="false" level="info">
139 <appender-ref ref="asyncEELFjettyAndNodelog"/>
140 </logger>
141
142 <root level="INFO">
143 <appender-ref ref="asyncEELF" />
144 <appender-ref ref="asyncEELFError" />
145 <appender-ref ref="asyncEELFjettyAndNodelog" />
146 </root>
147
148</configuration>