From 641323cf1ccb5b4a7941afbdd99695886b422e88 Mon Sep 17 00:00:00 2001 From: dotasek Date: Fri, 3 Jan 2025 11:22:02 -0500 Subject: [PATCH 1/2] .qos.logback-logback-core-1.5.13: Fix inclusion of logback-test in jar and fix classpath log configs --- org.hl7.fhir.r4/src/test/resources/logback-test.xml | 2 +- org.hl7.fhir.r4b/src/test/resources/logback-test.xml | 2 +- org.hl7.fhir.r5/src/test/resources/logback-test.xml | 2 +- org.hl7.fhir.validation.cli/pom.xml | 2 +- org.hl7.fhir.validation.cli/src/main/resources/logback.xml | 3 +-- .../src/main/java/org/hl7/fhir/validation/ValidatorCli.java | 3 +++ org.hl7.fhir.validation/src/test/resources/logback-test.xml | 4 +--- pom.xml | 6 ++++-- 8 files changed, 13 insertions(+), 11 deletions(-) diff --git a/org.hl7.fhir.r4/src/test/resources/logback-test.xml b/org.hl7.fhir.r4/src/test/resources/logback-test.xml index 1c8de9da34..d1189ab03e 100644 --- a/org.hl7.fhir.r4/src/test/resources/logback-test.xml +++ b/org.hl7.fhir.r4/src/test/resources/logback-test.xml @@ -1,4 +1,4 @@ - + diff --git a/org.hl7.fhir.r4b/src/test/resources/logback-test.xml b/org.hl7.fhir.r4b/src/test/resources/logback-test.xml index 1c8de9da34..d1189ab03e 100644 --- a/org.hl7.fhir.r4b/src/test/resources/logback-test.xml +++ b/org.hl7.fhir.r4b/src/test/resources/logback-test.xml @@ -1,4 +1,4 @@ - + diff --git a/org.hl7.fhir.r5/src/test/resources/logback-test.xml b/org.hl7.fhir.r5/src/test/resources/logback-test.xml index 1c8de9da34..d1189ab03e 100644 --- a/org.hl7.fhir.r5/src/test/resources/logback-test.xml +++ b/org.hl7.fhir.r5/src/test/resources/logback-test.xml @@ -1,4 +1,4 @@ - + diff --git a/org.hl7.fhir.validation.cli/pom.xml b/org.hl7.fhir.validation.cli/pom.xml index 0171497313..0cf2cc8431 100644 --- a/org.hl7.fhir.validation.cli/pom.xml +++ b/org.hl7.fhir.validation.cli/pom.xml @@ -304,7 +304,7 @@ unpack-dependencies - **/module-info.class,META-INF/* + **/module-info.class,META-INF/*,logback-test.xml ${project.build.directory}/classes false true diff --git a/org.hl7.fhir.validation.cli/src/main/resources/logback.xml b/org.hl7.fhir.validation.cli/src/main/resources/logback.xml index 7025a2b0d0..f9fcc0261a 100644 --- a/org.hl7.fhir.validation.cli/src/main/resources/logback.xml +++ b/org.hl7.fhir.validation.cli/src/main/resources/logback.xml @@ -1,5 +1,4 @@ - - + INFO diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidatorCli.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidatorCli.java index 70b39b68af..2b835ff4dc 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidatorCli.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidatorCli.java @@ -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); diff --git a/org.hl7.fhir.validation/src/test/resources/logback-test.xml b/org.hl7.fhir.validation/src/test/resources/logback-test.xml index 1c8de9da34..e18a0b9859 100644 --- a/org.hl7.fhir.validation/src/test/resources/logback-test.xml +++ b/org.hl7.fhir.validation/src/test/resources/logback-test.xml @@ -1,5 +1,4 @@ - - + INFO @@ -12,5 +11,4 @@ - \ No newline at end of file diff --git a/pom.xml b/pom.xml index 50a47e5443..7cbfa7a84c 100644 --- a/pom.xml +++ b/pom.xml @@ -43,6 +43,8 @@ 11 3.2.2 ${project.basedir} + 1.5.15 + 1.5.15 HL7 Core Artifacts @@ -313,13 +315,13 @@ ch.qos.logback logback-classic - 1.2.13 + ${logback-classic.version} ch.qos.logback logback-core - 1.5.13 + ${logback.version} From e6bcf5c7331795bbf74f568eea4e78675e0abf91 Mon Sep 17 00:00:00 2001 From: dotasek Date: Fri, 3 Jan 2025 13:12:29 -0500 Subject: [PATCH 2/2] Fix LoggingPolicy enum (use SLF4J) --- .../hl7/fhir/utilities/logging/ManagedLogging.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/logging/ManagedLogging.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/logging/ManagedLogging.java index 16a80b0aac..9ddba52b65 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/logging/ManagedLogging.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/logging/ManagedLogging.java @@ -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 * @@ -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 } @@ -98,7 +88,7 @@ public static void log(String message) throws IOException { case IGNORED: // nothing break; - case LOG4J: + case SLF4J: // todo break; default: