Skip to content

Commit e717d46

Browse files
authored
chore: log4j 2.20.0 (#1859)
1 parent 0d2c257 commit e717d46

File tree

9 files changed

+11
-67
lines changed

9 files changed

+11
-67
lines changed

caffeine-bounded-cache-support/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,13 @@
4444
</dependency>
4545
<dependency>
4646
<groupId>org.apache.logging.log4j</groupId>
47-
<artifactId>log4j-slf4j-impl</artifactId>
47+
<artifactId>log4j-slf4j2-impl</artifactId>
4848
<scope>test</scope>
4949
</dependency>
5050
<dependency>
5151
<groupId>org.apache.logging.log4j</groupId>
5252
<artifactId>log4j-core</artifactId>
5353
<version>${log4j.version}</version>
54-
<type>test-jar</type>
5554
<scope>test</scope>
5655
</dependency>
5756
<dependency>

operator-framework-core/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,13 @@
8181
</dependency>
8282
<dependency>
8383
<groupId>org.apache.logging.log4j</groupId>
84-
<artifactId>log4j-slf4j-impl</artifactId>
84+
<artifactId>log4j-slf4j2-impl</artifactId>
8585
<scope>test</scope>
8686
</dependency>
8787
<dependency>
8888
<groupId>org.apache.logging.log4j</groupId>
8989
<artifactId>log4j-core</artifactId>
9090
<version>${log4j.version}</version>
91-
<type>test-jar</type>
9291
<scope>test</scope>
9392
</dependency>
9493

operator-framework/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,13 @@
7272
</dependency>
7373
<dependency>
7474
<groupId>org.apache.logging.log4j</groupId>
75-
<artifactId>log4j-slf4j-impl</artifactId>
75+
<artifactId>log4j-slf4j2-impl</artifactId>
7676
<scope>test</scope>
7777
</dependency>
7878
<dependency>
7979
<groupId>org.apache.logging.log4j</groupId>
8080
<artifactId>log4j-core</artifactId>
8181
<version>${log4j.version}</version>
82-
<type>test-jar</type>
8382
<scope>test</scope>
8483
</dependency>
8584
<dependency>

operator-framework/src/test/java/io/javaoperatorsdk/operator/config/runtime/DefaultConfigurationServiceTest.java

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
package io.javaoperatorsdk.operator.config.runtime;
22

3-
import org.apache.logging.log4j.Level;
4-
import org.apache.logging.log4j.core.LoggerContext;
5-
import org.apache.logging.log4j.core.config.AppenderRef;
6-
import org.apache.logging.log4j.core.config.LoggerConfig;
7-
import org.apache.logging.log4j.core.layout.PatternLayout;
8-
import org.apache.logging.log4j.test.appender.ListAppender;
93
import org.junit.jupiter.api.Test;
104

115
import io.fabric8.kubernetes.client.CustomResource;
@@ -17,60 +11,13 @@
1711
import io.javaoperatorsdk.operator.api.reconciler.Reconciler;
1812
import io.javaoperatorsdk.operator.api.reconciler.UpdateControl;
1913

20-
import static org.assertj.core.api.Assertions.assertThat;
21-
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
22-
import static org.junit.jupiter.api.Assertions.assertEquals;
23-
import static org.junit.jupiter.api.Assertions.assertFalse;
14+
import static org.junit.jupiter.api.Assertions.*;
2415

2516
class DefaultConfigurationServiceTest {
2617

2718
public static final String CUSTOM_FINALIZER_NAME = "a.custom/finalizer";
2819
final DefaultConfigurationService configurationService = DefaultConfigurationService.instance();
2920

30-
@Test
31-
void attemptingToRetrieveAnUnknownControllerShouldLogWarning() {
32-
final LoggerContext context = LoggerContext.getContext(false);
33-
final PatternLayout layout = PatternLayout.createDefaultLayout(context.getConfiguration());
34-
final ListAppender appender = new ListAppender("list", null, layout, false, false);
35-
36-
appender.start();
37-
38-
context.getConfiguration().addAppender(appender);
39-
40-
AppenderRef ref = AppenderRef.createAppenderRef("list", null, null);
41-
final var loggerName = configurationService.getLoggerName();
42-
LoggerConfig loggerConfig =
43-
LoggerConfig.createLogger(
44-
false,
45-
Level.valueOf("info"),
46-
loggerName,
47-
"false",
48-
new AppenderRef[] {ref},
49-
null,
50-
context.getConfiguration(),
51-
null);
52-
loggerConfig.addAppender(appender, null, null);
53-
54-
context.getConfiguration().addLogger(loggerName, loggerConfig);
55-
context.updateLoggers();
56-
57-
try {
58-
final var config =
59-
configurationService
60-
.getConfigurationFor(new NotAutomaticallyCreated(), false);
61-
62-
assertThat(config).isNull();
63-
assertThat(appender.getMessages())
64-
.hasSize(1)
65-
.allMatch(m -> m.contains(NotAutomaticallyCreated.NAME) && m.contains("not found"));
66-
} finally {
67-
appender.stop();
68-
69-
context.getConfiguration().removeLogger(loggerName);
70-
context.updateLoggers();
71-
}
72-
}
73-
7421
@Test
7522
void returnsValuesFromControllerAnnotationFinalizer() {
7623
final var reconciler = new TestCustomReconciler();

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<junit.version>5.9.1</junit.version>
4747
<fabric8-client.version>6.5.1</fabric8-client.version>
4848
<slf4j.version>1.7.36</slf4j.version>
49-
<log4j.version>2.19.0</log4j.version>
49+
<log4j.version>2.20.0</log4j.version>
5050
<mokito.version>5.3.0</mokito.version>
5151
<commons-lang3.version>3.12.0</commons-lang3.version>
5252
<compile-testing.version>0.19</compile-testing.version>
@@ -159,12 +159,12 @@
159159
</dependency>
160160
<dependency>
161161
<groupId>org.apache.logging.log4j</groupId>
162-
<artifactId>log4j-slf4j-impl</artifactId>
162+
<artifactId>log4j-slf4j2-impl</artifactId>
163163
<version>${log4j.version}</version>
164164
</dependency>
165165
<dependency>
166166
<groupId>org.apache.logging.log4j</groupId>
167-
<artifactId>log4j-core</artifactId>
167+
<artifactId>log4j2-core</artifactId>
168168
<version>${log4j.version}</version>
169169
</dependency>
170170

sample-operators/leader-election/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</dependency>
4141
<dependency>
4242
<groupId>org.apache.logging.log4j</groupId>
43-
<artifactId>log4j-slf4j-impl</artifactId>
43+
<artifactId>log4j-slf4j2-impl</artifactId>
4444
</dependency>
4545
<dependency>
4646
<groupId>org.takes</groupId>

sample-operators/mysql-schema/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
</dependency>
6060
<dependency>
6161
<groupId>org.apache.logging.log4j</groupId>
62-
<artifactId>log4j-slf4j-impl</artifactId>
62+
<artifactId>log4j-slf4j2-impl</artifactId>
6363
</dependency>
6464
<dependency>
6565
<groupId>org.junit.jupiter</groupId>

sample-operators/tomcat-operator/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
</dependency>
5656
<dependency>
5757
<groupId>org.apache.logging.log4j</groupId>
58-
<artifactId>log4j-slf4j-impl</artifactId>
58+
<artifactId>log4j-slf4j2-impl</artifactId>
5959
</dependency>
6060
<dependency>
6161
<groupId>org.takes</groupId>

sample-operators/webpage/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</dependency>
4141
<dependency>
4242
<groupId>org.apache.logging.log4j</groupId>
43-
<artifactId>log4j-slf4j-impl</artifactId>
43+
<artifactId>log4j-slf4j2-impl</artifactId>
4444
</dependency>
4545
<dependency>
4646
<groupId>org.takes</groupId>

0 commit comments

Comments
 (0)