Skip to content

Commit

Permalink
Fix logback configs + update logback (#1868)
Browse files Browse the repository at this point in the history
* .qos.logback-logback-core-1.5.13: Fix inclusion of logback-test in jar and fix classpath log configs

* Fix LoggingPolicy enum (use SLF4J)
  • Loading branch information
dotasek authored Jan 3, 2025
1 parent 251c29c commit 9cc31c5
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 23 deletions.
2 changes: 1 addition & 1 deletion org.hl7.fhir.r4/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<configuration scan="true" scanPeriod="30 seconds">
<configuration>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
Expand Down
2 changes: 1 addition & 1 deletion org.hl7.fhir.r4b/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<configuration scan="true" scanPeriod="30 seconds">
<configuration>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
Expand Down
2 changes: 1 addition & 1 deletion org.hl7.fhir.r5/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<configuration scan="true" scanPeriod="30 seconds">
<configuration>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,10 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS



import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;

import javax.annotation.Nonnull;

import org.hl7.fhir.utilities.Utilities;

/**
* see security.md - manages logging by the FHIR HAPI Core library
*
Expand All @@ -60,7 +50,7 @@ public interface ILoggingProvider {
public enum LoggingPolicy {
CONSOLE, // log messages go to System.out (default)
IGNORED, // log messages don't go anywhere
LOG4J, // log messages go to Log4J
SLF4J, // log messages go to SLF4J
CUSTOM, // log messages to an ILoggingProvider implementation
}

Expand Down Expand Up @@ -98,7 +88,7 @@ public static void log(String message) throws IOException {
case IGNORED:
// nothing
break;
case LOG4J:
case SLF4J:
// todo
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion org.hl7.fhir.validation.cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<excludes>**/module-info.class,META-INF/*</excludes>
<excludes>**/module-info.class,META-INF/*,logback-test.xml</excludes>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
Expand Down
3 changes: 1 addition & 2 deletions org.hl7.fhir.validation.cli/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<configuration scan="true" scanPeriod="30 seconds">

<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ private void displayHelpForTask(CliTask cliTask) {
}

public static void main(String[] args) throws Exception {
// Prevents SLF4J(I) from printing unnecessary info to the console.
System.setProperty("slf4j.internal.verbosity", "WARN");

final ValidatorCli validatorCli = new ValidatorCli(validationService);

args = addAdditionalParamsForIpsParam(args);
Expand Down
4 changes: 1 addition & 3 deletions org.hl7.fhir.validation/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<configuration scan="true" scanPeriod="30 seconds">

<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
Expand All @@ -12,5 +11,4 @@
<root level="info">
<appender-ref ref="STDOUT" />
</root>

</configuration>
6 changes: 4 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
<maven.compiler.testTarget>11</maven.compiler.testTarget>
<maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
<checkstyle_config_location>${project.basedir}</checkstyle_config_location>
<logback-classic.version>1.5.15</logback-classic.version>
<logback.version>1.5.15</logback.version>
</properties>

<name>HL7 Core Artifacts</name>
Expand Down Expand Up @@ -313,13 +315,13 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.13</version>
<version>${logback-classic.version}</version>
</dependency>

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.5.13</version>
<version>${logback.version}</version>
</dependency>

<dependency>
Expand Down

0 comments on commit 9cc31c5

Please sign in to comment.