Merge pull request #82 from tkowalcz/log4j-2.16

Log4j 2.16
This commit is contained in:
Tomasz Kowalczewski authored and GitHub committed 2021-12-15 11:34:50 +01:00
commit d286bf64c5
4 files changed
+10 -14

No files matched your search

+2 -2
View File
@@ -22,7 +22,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.13.3</version>
<version>2.16.0</version>
</dependency>
<dependency>
@@ -36,7 +36,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.13.3</version>
<version>2.16.0</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -31,17 +31,16 @@ public class Log4jAdapterLabelPrinter implements LabelPrinter {
@Override
public boolean isStatic() {
for (int i = 0; i < formatters.size(); i++) {
for (int i = 0; i < formatters.size(); i = i + 1) {
LogEventPatternConverter converter = formatters.get(i).getConverter();
if (!(converter instanceof LiteralPatternConverter)) {
return false;
}
if (((LiteralPatternConverter) converter).getLiteral().contains("$")) {
return false;
if (converter instanceof LiteralPatternConverter) {
if (((LiteralPatternConverter) converter).getLiteral().contains("$")) {
return false;
}
}
return !converter.isVariable();
}
return true;
@@ -47,9 +47,6 @@ class LokiAppenderMonitoringTest {
await()
.atMost(Durations.ONE_MINUTE)
.pollInterval(Durations.ONE_SECOND)
.untilAsserted(() -> {
assertThat(connectAttemptsCounter.getCount()).isEqualTo(1);
}
);
.untilAsserted(() -> assertThat(connectAttemptsCounter.getCount()).isGreaterThan(0));
}
}
@@ -98,7 +98,7 @@ class Log4jAdapterLabelPrinterTest {
Arguments.of("Empty", "", true),
Arguments.of("Literal value", "literal value", true),
Arguments.of("Literal value with variable", "Literal & variable: ${server}", false),
Arguments.of("Contains pattern", "With pattern %c{1}", false)
Arguments.of("Contains pattern", "With pattern %c{1}", true) // Since 2.15.0 no interpolation possible
);
}