diff --git a/app/pom.xml b/app/pom.xml index 8b5116e..d0712eb 100644 --- a/app/pom.xml +++ b/app/pom.xml @@ -39,7 +39,7 @@ SPDX-License-Identifier: Apache-2.0 org.lfenergy.compas.core - jaxrs-commons + rest-commons @@ -52,27 +52,34 @@ SPDX-License-Identifier: Apache-2.0 io.quarkus - quarkus-smallrye-jwt + quarkus-resteasy-jaxb io.quarkus - quarkus-smallrye-openapi + quarkus-hibernate-validator + io.quarkus - quarkus-smallrye-health + quarkus-smallrye-jwt io.quarkus - quarkus-resteasy-jaxb + quarkus-smallrye-openapi io.quarkus - quarkus-container-image-docker + quarkus-smallrye-health + + + + org.jboss.logmanager + log4j2-jboss-logmanager + io.quarkus - quarkus-hibernate-validator + quarkus-container-image-docker diff --git a/app/src/main/docker/Dockerfile.jvm b/app/src/main/docker/Dockerfile.jvm index ab847d9..ee8b2bf 100644 --- a/app/src/main/docker/Dockerfile.jvm +++ b/app/src/main/docker/Dockerfile.jvm @@ -21,7 +21,7 @@ # docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/app-jvm # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7 +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7-923 ARG JAVA_PACKAGE=java-17-openjdk-headless ARG RUN_JAVA_VERSION=1.3.8 diff --git a/app/src/main/docker/Dockerfile.native b/app/src/main/docker/Dockerfile.native index 414d9f7..95c9f04 100644 --- a/app/src/main/docker/Dockerfile.native +++ b/app/src/main/docker/Dockerfile.native @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/app # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7 +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.7-923 WORKDIR /work/ RUN chown 1001 /work \ && chmod "g+rwX" /work \ diff --git a/app/src/main/java/org/lfenergy/compas/scl/auto/alignment/rest/CompasSclAutoAlignmentConfiguration.java b/app/src/main/java/org/lfenergy/compas/scl/auto/alignment/rest/CompasSclAutoAlignmentConfiguration.java index 9d4fd90..08775c7 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/auto/alignment/rest/CompasSclAutoAlignmentConfiguration.java +++ b/app/src/main/java/org/lfenergy/compas/scl/auto/alignment/rest/CompasSclAutoAlignmentConfiguration.java @@ -14,8 +14,8 @@ */ @RegisterForReflection(targets = {com.powsybl.sld.library.Components.class, com.powsybl.sld.library.Component.class, - org.lfenergy.compas.core.jaxrs.model.ErrorResponse.class, - org.lfenergy.compas.core.jaxrs.model.ErrorMessage.class}) + org.lfenergy.compas.core.commons.model.ErrorResponse.class, + org.lfenergy.compas.core.commons.model.ErrorMessage.class}) public class CompasSclAutoAlignmentConfiguration { @Produces @ApplicationScoped diff --git a/app/src/main/java/org/lfenergy/compas/scl/auto/alignment/rest/v1/SclAutoAlignmentResource.java b/app/src/main/java/org/lfenergy/compas/scl/auto/alignment/rest/v1/SclAutoAlignmentResource.java index 79c1c5d..2814585 100644 --- a/app/src/main/java/org/lfenergy/compas/scl/auto/alignment/rest/v1/SclAutoAlignmentResource.java +++ b/app/src/main/java/org/lfenergy/compas/scl/auto/alignment/rest/v1/SclAutoAlignmentResource.java @@ -4,14 +4,14 @@ package org.lfenergy.compas.scl.auto.alignment.rest.v1; import io.quarkus.security.Authenticated; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.eclipse.microprofile.jwt.JsonWebToken; import org.lfenergy.compas.scl.auto.alignment.rest.UserInfoProperties; import org.lfenergy.compas.scl.auto.alignment.rest.v1.model.SclAutoAlignRequest; import org.lfenergy.compas.scl.auto.alignment.rest.v1.model.SclAutoAlignResponse; import org.lfenergy.compas.scl.auto.alignment.rest.v1.model.SclAutoAlignSVGRequest; import org.lfenergy.compas.scl.auto.alignment.service.SclAutoAlignmentService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import javax.enterprise.context.RequestScoped; import javax.inject.Inject; @@ -26,7 +26,7 @@ @RequestScoped @Path("/auto/alignment/v1") public class SclAutoAlignmentResource { - private static final Logger LOGGER = LoggerFactory.getLogger(SclAutoAlignmentResource.class); + private static final Logger LOGGER = LogManager.getLogger(SclAutoAlignmentResource.class); private final SclAutoAlignmentService sclAutoAlignmentService; @@ -45,6 +45,8 @@ public SclAutoAlignmentResource(SclAutoAlignmentService compasCimMappingService) @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML) public SclAutoAlignResponse alignment(@Valid SclAutoAlignRequest request) { + LOGGER.info("Auto align SCL for Substation(s) {}.", request.getSubstationNames()); + String who = jsonWebToken.getClaim(userInfoProperties.who()); LOGGER.trace("Username used for Who {}", who); @@ -58,6 +60,7 @@ public SclAutoAlignResponse alignment(@Valid SclAutoAlignRequest request) { @Produces(MediaType.APPLICATION_SVG_XML) @Path("/svg") public String svg(@Valid SclAutoAlignSVGRequest request) { + LOGGER.info("Creating SVG for Substation {}.", request.getSubstationName()); return sclAutoAlignmentService.getSVG(request.getSclData(), request.getSubstationName()); } } \ No newline at end of file diff --git a/app/src/main/resources/application.properties b/app/src/main/resources/application.properties index 939f599..09ee54c 100644 --- a/app/src/main/resources/application.properties +++ b/app/src/main/resources/application.properties @@ -15,8 +15,8 @@ quarkus.log.category."org.lfenergy.compas.scl.auto.alignment".level = INFO quarkus.index-dependency.compas-commons.group-id = org.lfenergy.compas.core quarkus.index-dependency.compas-commons.artifact-id = commons -quarkus.index-dependency.jaxrs-commons.group-id = org.lfenergy.compas.core -quarkus.index-dependency.jaxrs-commons.artifact-id = jaxrs-commons +quarkus.index-dependency.rest-commons.group-id = org.lfenergy.compas.core +quarkus.index-dependency.rest-commons.artifact-id = rest-commons quarkus.index-dependency.jaxb-api.group-id = org.jboss.spec.javax.xml.bind quarkus.index-dependency.jaxb-api.artifact-id = jboss-jaxb-api_2.3_spec @@ -32,6 +32,7 @@ quarkus.native.resources.includes=ConvergenceLibrary/*.*,*.css %dev.quarkus.http.cors = true %dev.quarkus.log.level = DEBUG +%dev.quarkus.log.category."com.powsybl".level = INFO %dev.quarkus.log.category."org.lfenergy.compas.scl.auto.alignment".level = DEBUG # Smallrye JWT Properties (Microprofile) diff --git a/pom.xml b/pom.xml index ca73df4..ae7845f 100644 --- a/pom.xml +++ b/pom.xml @@ -23,11 +23,11 @@ SPDX-License-Identifier: Apache-2.0 3.0.0-M7 3.2.0 - 0.9.3 + 0.11.0 - 2.14.0.Final - 2.0.3 - 2.13.1 + 2.14.1.Final + 2.19.0 + 3.0.0 2.10 0.9.1 @@ -76,7 +76,7 @@ SPDX-License-Identifier: Apache-2.0 org.lfenergy.compas.core - jaxrs-commons + rest-commons ${compas.core.version} @@ -95,13 +95,24 @@ SPDX-License-Identifier: Apache-2.0 org.eclipse.microprofile.openapi microprofile-openapi-api - 3.0 + 3.1 - org.slf4j - slf4j-simple - ${slf4j.version} + org.apache.logging.log4j + log4j-api + ${log4j2.version} + + + org.apache.logging.log4j + log4j-core + ${log4j2.version} + + + + org.apache.logging.log4j + log4j-slf4j-impl + ${log4j2.version} diff --git a/service/pom.xml b/service/pom.xml index d6a0693..cdff484 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -42,8 +42,19 @@ SPDX-License-Identifier: Apache-2.0 - org.slf4j - slf4j-api + org.apache.logging.log4j + log4j-api + + + org.apache.logging.log4j + log4j-core + provided + + + + org.apache.logging.log4j + log4j-slf4j-impl + provided @@ -57,11 +68,6 @@ SPDX-License-Identifier: Apache-2.0 junit-jupiter-engine test - - org.slf4j - slf4j-simple - test - com.openpojo openpojo diff --git a/service/src/test/resources/log4j2.xml b/service/src/test/resources/log4j2.xml new file mode 100644 index 0000000..1887563 --- /dev/null +++ b/service/src/test/resources/log4j2.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + +