Skip to content

Commit 716b3a9

Browse files
committed
ATLAS-4917: replace use of log4j with logback
1 parent 63b396a commit 716b3a9

File tree

67 files changed

+2046
-2267
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+2046
-2267
lines changed

addons/couchbase-bridge/src/test/resources/log4j.xml addons/couchbase-bridge/src/test/resources/logback.xml

+17-14
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,22 @@
1717
~ limitations under the License.
1818
-->
1919

20-
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
20+
<configuration>
21+
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
22+
<param name="Target" value="System.out"/>
23+
<encoder>
24+
<pattern>%date [%thread] %level{5} [%file:%line] %msg%n</pattern>
25+
</encoder>
26+
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
27+
<level>INFO</level>
28+
</filter>
29+
</appender>
2130

22-
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
23-
<appender name="console" class="org.apache.log4j.ConsoleAppender">
24-
<param name="Target" value="System.out"/>
25-
<layout class="org.apache.log4j.PatternLayout">
26-
<param name="ConversionPattern" value="%d %-5p - [%t:%x] ~ %m (%C{1}:%L)%n"/>
27-
</layout>
28-
</appender>
31+
<logger name="org.apache.atlas" additivity="false" level="info">
32+
<appender-ref ref="console"/>
33+
</logger>
2934

30-
<root>
31-
<level value="DEBUG"/>
32-
<appender-ref ref="console"/>
33-
</root>
34-
35-
</log4j:configuration>
35+
<root level="DEBUG">
36+
<appender-ref ref="console"/>
37+
</root>
38+
</configuration>

addons/falcon-bridge/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@
262262
<value>application.log</value>
263263
</systemProperty>
264264
<systemProperty>
265-
<name>log4j.configuration</name>
266-
<value>file:///${project.build.directory}/test-classes/atlas-log4j.xml</value>
265+
<name>logback.configurationFile</name>
266+
<value>file:///${project.build.directory}/test-classes/atlas-logback.xml</value>
267267
</systemProperty>
268268
<systemProperty>
269269
<name>atlas.graphdb.backend</name>

addons/falcon-bridge/src/test/resources/atlas-log4j.xml

-137
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!--
3+
~ Licensed to the Apache Software Foundation (ASF) under one
4+
~ or more contributor license agreements. See the NOTICE file
5+
~ distributed with this work for additional information
6+
~ regarding copyright ownership. The ASF licenses this file
7+
~ to you under the Apache License, Version 2.0 (the
8+
~ "License"); you may not use this file except in compliance
9+
~ with the License. You may obtain a copy of the License at
10+
~
11+
~ http://www.apache.org/licenses/LICENSE-2.0
12+
~
13+
~ Unless required by applicable law or agreed to in writing, software
14+
~ distributed under the License is distributed on an "AS IS" BASIS,
15+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
~ See the License for the specific language governing permissions and
17+
~ limitations under the License.
18+
-->
19+
20+
<configuration>
21+
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
22+
<param name="Target" value="System.out"/>
23+
<encoder>
24+
<pattern>%date [%thread] %level{5} [%file:%line] %msg%n</pattern>
25+
</encoder>
26+
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
27+
<level>INFO</level>
28+
</filter>
29+
</appender>
30+
31+
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
32+
<file>${atlas.log.dir}/${atlas.log.file}</file>
33+
<append>true</append>
34+
<encoder>
35+
<pattern>%date [%thread] %level{5} [%file:%line] %msg%n</pattern>
36+
</encoder>
37+
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
38+
<fileNamePattern>${atlas.log.dir}/${atlas.log.file}-%d</fileNamePattern>
39+
<maxHistory>20</maxHistory>
40+
<cleanHistoryOnStart>true</cleanHistoryOnStart>
41+
</rollingPolicy>
42+
</appender>
43+
44+
<appender name="AUDIT" class="ch.qos.logback.core.rolling.RollingFileAppender">
45+
<file>${atlas.log.dir}/audit.log</file>
46+
<append>true</append>
47+
<encoder>
48+
<pattern>%date [%thread] %level{5} [%file:%line] %msg%n</pattern>
49+
</encoder>
50+
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
51+
<fileNamePattern>${atlas.log.dir}/audit-%d.log</fileNamePattern>
52+
<maxHistory>20</maxHistory>
53+
<cleanHistoryOnStart>false</cleanHistoryOnStart>
54+
</rollingPolicy>
55+
</appender>
56+
57+
<appender name="METRICS" class="ch.qos.logback.core.rolling.RollingFileAppender">
58+
<file>${atlas.log.dir}/metrics.log</file>
59+
<append>true</append>
60+
<encoder>
61+
<pattern>%date [%thread] %level{5} [%file:%line] %msg%n</pattern>
62+
</encoder>
63+
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
64+
<fileNamePattern>${atlas.log.dir}/metrics-%d.log</fileNamePattern>
65+
<maxHistory>20</maxHistory>
66+
<cleanHistoryOnStart>false</cleanHistoryOnStart>
67+
</rollingPolicy>
68+
</appender>
69+
70+
<appender name="FAILED" class="ch.qos.logback.core.rolling.RollingFileAppender">
71+
<file>${atlas.log.dir}/failed.log</file>
72+
<append>true</append>
73+
<encoder>
74+
<pattern>%date [%thread] %level{5} [%file:%line] %msg%n</pattern>
75+
</encoder>
76+
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
77+
<fileNamePattern>${atlas.log.dir}/failed-%d.log</fileNamePattern>
78+
<maxHistory>20</maxHistory>
79+
<cleanHistoryOnStart>false</cleanHistoryOnStart>
80+
</rollingPolicy>
81+
</appender>
82+
83+
<logger name="org.apache.atlas" additivity="false" level="info">
84+
<appender-ref ref="FILE"/>
85+
</logger>
86+
87+
<logger name="org.apache.atlas.impala.ImpalaLineageTool" additivity="false" level="debug">
88+
<appender-ref ref="FILE"/>
89+
</logger>
90+
91+
<logger name="org.apache.atlas.impala.hook.ImpalaLineageHook" additivity="false" level="debug">
92+
<appender-ref ref="FILE"/>
93+
</logger>
94+
95+
<logger name="org.janusgraph" additivity="false" level="warn">
96+
<appender-ref ref="FILE"/>
97+
</logger>
98+
99+
<logger name="org.springframework" additivity="false" level="warn">
100+
<appender-ref ref="console"/>
101+
</logger>
102+
103+
<logger name="org.eclipse" additivity="false" level="warn">
104+
<appender-ref ref="console"/>
105+
</logger>
106+
107+
<logger name="com.sun.jersey" additivity="false" level="warn">
108+
<appender-ref ref="console"/>
109+
</logger>
110+
111+
112+
<!-- to avoid logs - The configuration log.flush.interval.messages = 1 was supplied but isn't a known config -->
113+
<logger name="org.apache.kafka.common.config.AbstractConfig" additivity="false" level="error">
114+
<appender-ref ref="FILE"/>
115+
</logger>
116+
117+
<logger name="METRICS" additivity="false" level="debug">
118+
<appender-ref ref="METRICS"/>
119+
</logger>
120+
121+
<logger name="FAILED" additivity="false" level="info">
122+
<appender-ref ref="FAILED"/>
123+
</logger>
124+
125+
<logger name="AUDIT" additivity="false" level="info">
126+
<appender-ref ref="AUDIT"/>
127+
</logger>
128+
129+
<root level="warn">
130+
<appender-ref ref="FILE"/>
131+
</root>
132+
</configuration>

addons/hbase-bridge/pom.xml

+5-10
Original file line numberDiff line numberDiff line change
@@ -400,14 +400,9 @@
400400
<version>${jersey.version}</version>
401401
</artifactItem>
402402
<artifactItem>
403-
<groupId>org.apache.logging.log4j</groupId>
404-
<artifactId>log4j-core</artifactId>
405-
<version>${log4j2.version}</version>
406-
</artifactItem>
407-
<artifactItem>
408-
<groupId>org.apache.logging.log4j</groupId>
409-
<artifactId>log4j-api</artifactId>
410-
<version>${log4j2.version}</version>
403+
<groupId>ch.qos.logback</groupId>
404+
<artifactId>logback-classic</artifactId>
405+
<version>${logback.version}</version>
411406
</artifactItem>
412407
</artifactItems>
413408
</configuration>
@@ -487,8 +482,8 @@
487482
<value>application.log</value>
488483
</systemProperty>
489484
<systemProperty>
490-
<name>log4j.configuration</name>
491-
<value>file:///${project.build.directory}/test-classes/atlas-log4j.xml</value>
485+
<name>logback.configurationFile</name>
486+
<value>file:///${project.build.directory}/test-classes/atlas-logback.xml</value>
492487
</systemProperty>
493488
<systemProperty>
494489
<name>atlas.graphdb.backend</name>

0 commit comments

Comments
 (0)