From 19ccba424bfe418c834942f9163a9ad4d8676993 Mon Sep 17 00:00:00 2001 From: Joe DiPol Date: Wed, 12 Feb 2025 00:28:01 -0800 Subject: [PATCH 1/2] 4.x: Use HelidonConsoleHandler more consistently (#126) --- .../src/main/resources/logging.properties | 10 ++++---- .../src/main/resources/logging.properties | 10 ++++---- examples/microprofile/oidc/pom.xml | 5 ++++ .../src/main/resources/logging.properties | 12 +++++----- .../src/main/resources/logging.properties | 21 ++++------------ .../src/main/resources/logging.properties | 5 ++-- .../helidon-standalone-quickstart-mp/pom.xml | 2 +- .../src/main/resources/logging.properties | 24 +++++-------------- .../helidon-standalone-quickstart-se/pom.xml | 5 ++++ .../src/main/resources/logging.properties | 7 +++--- examples/security/outbound-override/pom.xml | 5 ++++ .../outbound/OutboundOverrideExample.java | 7 +++++- .../src/main/resources/logging.properties | 14 +++++------ examples/webserver/basic/pom.xml | 5 ++++ .../examples/webserver/basic/BasicMain.java | 7 +++++- .../src/main/resources/logging.properties | 11 +++++---- examples/webserver/observe/pom.xml | 5 ++++ .../src/main/resources/logging.properties | 11 +++++---- .../src/main/resources/logging.properties | 12 ++++++---- examples/webserver/protocols/pom.xml | 5 ++++ .../src/main/resources/logging.properties | 11 +++++---- .../src/main/resources/logging.properties | 11 +++++---- 22 files changed, 119 insertions(+), 86 deletions(-) diff --git a/examples/media/form/src/main/resources/logging.properties b/examples/media/form/src/main/resources/logging.properties index ccdbe8a09..29b5e9044 100644 --- a/examples/media/form/src/main/resources/logging.properties +++ b/examples/media/form/src/main/resources/logging.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2018, 2024 Oracle and/or its affiliates. +# Copyright (c) 2018, 2025 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,8 +14,10 @@ # limitations under the License. # -handlers=java.util.logging.ConsoleHandler -java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %5$s%6$s%n +handlers=io.helidon.logging.jul.HelidonConsoleHandler +java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %5$s%6$s%n +#java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %3$s !thread!: %5$s%6$s%n + # Global logging level. Can be overridden by specific loggers .level=INFO -io.helidon.webserver.level=INFO +io.helidon.level=INFO diff --git a/examples/media/multipart/src/main/resources/logging.properties b/examples/media/multipart/src/main/resources/logging.properties index ccdbe8a09..29b5e9044 100644 --- a/examples/media/multipart/src/main/resources/logging.properties +++ b/examples/media/multipart/src/main/resources/logging.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2018, 2024 Oracle and/or its affiliates. +# Copyright (c) 2018, 2025 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,8 +14,10 @@ # limitations under the License. # -handlers=java.util.logging.ConsoleHandler -java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %5$s%6$s%n +handlers=io.helidon.logging.jul.HelidonConsoleHandler +java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %5$s%6$s%n +#java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %3$s !thread!: %5$s%6$s%n + # Global logging level. Can be overridden by specific loggers .level=INFO -io.helidon.webserver.level=INFO +io.helidon.level=INFO diff --git a/examples/microprofile/oidc/pom.xml b/examples/microprofile/oidc/pom.xml index b7ec7ccdf..cdf8cfdb8 100644 --- a/examples/microprofile/oidc/pom.xml +++ b/examples/microprofile/oidc/pom.xml @@ -48,6 +48,11 @@ io.helidon.microprofile helidon-microprofile-oidc + + io.helidon.logging + helidon-logging-jul + runtime + io.smallrye jandex diff --git a/examples/microprofile/oidc/src/main/resources/logging.properties b/examples/microprofile/oidc/src/main/resources/logging.properties index e925738a6..cec764cdf 100644 --- a/examples/microprofile/oidc/src/main/resources/logging.properties +++ b/examples/microprofile/oidc/src/main/resources/logging.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2019, 2024 Oracle and/or its affiliates. +# Copyright (c) 2019, 2025 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,11 +14,8 @@ # limitations under the License. # -handlers = java.util.logging.ConsoleHandler - -java.util.logging.ConsoleHandler.level = FINEST -java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter -java.util.logging.SimpleFormatter.format = [%1$tc] %4$s: %2$s - %5$s %6$s%n +handlers=io.helidon.logging.jul.HelidonConsoleHandler +java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %5$s%6$s%n .level = INFO io.helidon.config.level = WARNING @@ -26,3 +23,6 @@ io.helidon.config.level = WARNING AUDIT.level=FINEST # to see detailed information about failed validations of tokens io.helidon.security.providers.oidc.level=FINEST + +# Quiet Weld +org.jboss.level=WARNING diff --git a/examples/quickstarts/helidon-quickstart-mp/src/main/resources/logging.properties b/examples/quickstarts/helidon-quickstart-mp/src/main/resources/logging.properties index d19bc389d..93759fd56 100644 --- a/examples/quickstarts/helidon-quickstart-mp/src/main/resources/logging.properties +++ b/examples/quickstarts/helidon-quickstart-mp/src/main/resources/logging.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2018, 2024 Oracle and/or its affiliates. +# Copyright (c) 2018, 2025 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,26 +14,13 @@ # limitations under the License. # -# Example Logging Configuration File -# For more information see $JAVA_HOME/jre/lib/logging.properties - -# Send messages to the console handlers=io.helidon.logging.jul.HelidonConsoleHandler - -# HelidonConsoleHandler uses a SimpleFormatter subclass that replaces "!thread!" with the current thread -java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS %4$s %3$s !thread!: %5$s%6$s%n +java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %5$s%6$s%n +#java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %3$s !thread!: %5$s%6$s%n # Global logging level. Can be overridden by specific loggers .level=INFO +io.helidon.level=INFO # Quiet Weld org.jboss.level=WARNING - -# Component specific log levels -#io.helidon.webserver.level=INFO -#io.helidon.config.level=INFO -#io.helidon.security.level=INFO -#io.helidon.microprofile.level=INFO -#io.helidon.common.level=INFO -#org.glassfish.jersey.level=INFO -#org.jboss.weld=INFO diff --git a/examples/quickstarts/helidon-quickstart-se/src/main/resources/logging.properties b/examples/quickstarts/helidon-quickstart-se/src/main/resources/logging.properties index b26c53a19..6a10b0d7a 100644 --- a/examples/quickstarts/helidon-quickstart-se/src/main/resources/logging.properties +++ b/examples/quickstarts/helidon-quickstart-se/src/main/resources/logging.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2023, 2024 Oracle and/or its affiliates. +# Copyright (c) 2023, 2025 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,7 +15,8 @@ # handlers=io.helidon.logging.jul.HelidonConsoleHandler -java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %5$s%6$s%n +java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %5$s%6$s%n +#java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %3$s !thread!: %5$s%6$s%n # Global logging level. Can be overridden by specific loggers .level=INFO diff --git a/examples/quickstarts/helidon-standalone-quickstart-mp/pom.xml b/examples/quickstarts/helidon-standalone-quickstart-mp/pom.xml index 66ecd0a6b..e63a6a5e2 100644 --- a/examples/quickstarts/helidon-standalone-quickstart-mp/pom.xml +++ b/examples/quickstarts/helidon-standalone-quickstart-mp/pom.xml @@ -27,7 +27,7 @@ 4.2.0-SNAPSHOT - io.helidon.microprofile.cdi.Main + io.helidon.Main 21 ${maven.compiler.source} diff --git a/examples/quickstarts/helidon-standalone-quickstart-mp/src/main/resources/logging.properties b/examples/quickstarts/helidon-standalone-quickstart-mp/src/main/resources/logging.properties index 7b395f50e..93759fd56 100644 --- a/examples/quickstarts/helidon-standalone-quickstart-mp/src/main/resources/logging.properties +++ b/examples/quickstarts/helidon-standalone-quickstart-mp/src/main/resources/logging.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2018, 2024 Oracle and/or its affiliates. +# Copyright (c) 2018, 2025 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,25 +14,13 @@ # limitations under the License. # -# Example Logging Configuration File -# For more information see $JAVA_HOME/jre/lib/logging.properties - -## Send messages to the console handlers=io.helidon.logging.jul.HelidonConsoleHandler -# -## HelidonConsoleHandler uses a SimpleFormatter subclass that replaces "!thread!" with the current thread -java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS %4$s %3$s !thread!: %5$s%6$s%n -# -## Global logging level. Can be overridden by specific loggers +java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %5$s%6$s%n +#java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %3$s !thread!: %5$s%6$s%n + +# Global logging level. Can be overridden by specific loggers .level=INFO +io.helidon.level=INFO # Quiet Weld org.jboss.level=WARNING - -# Component specific log levels -#io.helidon.webserver.level=INFO -#io.helidon.config.level=INFO -#io.helidon.security.level=INFO -#io.helidon.microprofile.level=INFO -#io.helidon.common.level=INFO -#org.jboss.weld=INFO diff --git a/examples/quickstarts/helidon-standalone-quickstart-se/pom.xml b/examples/quickstarts/helidon-standalone-quickstart-se/pom.xml index f2a266942..9ad7817c9 100644 --- a/examples/quickstarts/helidon-standalone-quickstart-se/pom.xml +++ b/examples/quickstarts/helidon-standalone-quickstart-se/pom.xml @@ -103,6 +103,11 @@ jakarta.json jakarta.json-api + + io.helidon.logging + helidon-logging-jul + runtime + org.junit.jupiter junit-jupiter-api diff --git a/examples/quickstarts/helidon-standalone-quickstart-se/src/main/resources/logging.properties b/examples/quickstarts/helidon-standalone-quickstart-se/src/main/resources/logging.properties index 717a25c4a..6a10b0d7a 100644 --- a/examples/quickstarts/helidon-standalone-quickstart-se/src/main/resources/logging.properties +++ b/examples/quickstarts/helidon-standalone-quickstart-se/src/main/resources/logging.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2023, 2024 Oracle and/or its affiliates. +# Copyright (c) 2023, 2025 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,8 +14,9 @@ # limitations under the License. # -handlers=java.util.logging.ConsoleHandler -java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %5$s%6$s%n +handlers=io.helidon.logging.jul.HelidonConsoleHandler +java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %5$s%6$s%n +#java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %3$s !thread!: %5$s%6$s%n # Global logging level. Can be overridden by specific loggers .level=INFO diff --git a/examples/security/outbound-override/pom.xml b/examples/security/outbound-override/pom.xml index 14e6a7c2c..cedb729e4 100644 --- a/examples/security/outbound-override/pom.xml +++ b/examples/security/outbound-override/pom.xml @@ -65,6 +65,11 @@ io.helidon.bundles helidon-bundles-config + + io.helidon.logging + helidon-logging-jul + runtime + io.helidon.webserver.testing.junit5 helidon-webserver-testing-junit5 diff --git a/examples/security/outbound-override/src/main/java/io/helidon/security/examples/outbound/OutboundOverrideExample.java b/examples/security/outbound-override/src/main/java/io/helidon/security/examples/outbound/OutboundOverrideExample.java index b79d5519a..21f101033 100644 --- a/examples/security/outbound-override/src/main/java/io/helidon/security/examples/outbound/OutboundOverrideExample.java +++ b/examples/security/outbound-override/src/main/java/io/helidon/security/examples/outbound/OutboundOverrideExample.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2024 Oracle and/or its affiliates. + * Copyright (c) 2018, 2025 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ import io.helidon.config.Config; import io.helidon.config.ConfigSources; +import io.helidon.logging.common.LogConfig; import io.helidon.security.Principal; import io.helidon.security.SecurityContext; import io.helidon.security.Subject; @@ -48,6 +49,10 @@ private OutboundOverrideExample() { * @param args ignored */ public static void main(String[] args) { + + // load logging configuration + LogConfig.configureRuntime(); + WebServerConfig.Builder builder = WebServer.builder(); setup(builder); WebServer server = builder.build(); diff --git a/examples/security/outbound-override/src/main/resources/logging.properties b/examples/security/outbound-override/src/main/resources/logging.properties index 051148a14..6a10b0d7a 100644 --- a/examples/security/outbound-override/src/main/resources/logging.properties +++ b/examples/security/outbound-override/src/main/resources/logging.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2023, 2024 Oracle and/or its affiliates. +# Copyright (c) 2023, 2025 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,10 +14,10 @@ # limitations under the License. # -handlers = java.util.logging.ConsoleHandler +handlers=io.helidon.logging.jul.HelidonConsoleHandler +java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %5$s%6$s%n +#java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %3$s !thread!: %5$s%6$s%n -java.util.logging.ConsoleHandler.level = FINEST -java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter -java.util.logging.SimpleFormatter.format = [%1$tc] %4$s: %2$s - %5$s %6$s%n - -.level = INFO +# Global logging level. Can be overridden by specific loggers +.level=INFO +io.helidon.level=INFO diff --git a/examples/webserver/basic/pom.xml b/examples/webserver/basic/pom.xml index 75cae966b..488bd0e32 100644 --- a/examples/webserver/basic/pom.xml +++ b/examples/webserver/basic/pom.xml @@ -39,6 +39,11 @@ io.helidon.webserver helidon-webserver + + io.helidon.logging + helidon-logging-jul + runtime + io.helidon.webserver.testing.junit5 helidon-webserver-testing-junit5 diff --git a/examples/webserver/basic/src/main/java/io/helidon/examples/webserver/basic/BasicMain.java b/examples/webserver/basic/src/main/java/io/helidon/examples/webserver/basic/BasicMain.java index 87ec5bf0c..ae8d7dfb1 100644 --- a/examples/webserver/basic/src/main/java/io/helidon/examples/webserver/basic/BasicMain.java +++ b/examples/webserver/basic/src/main/java/io/helidon/examples/webserver/basic/BasicMain.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2024 Oracle and/or its affiliates. + * Copyright (c) 2022, 2025 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ package io.helidon.examples.webserver.basic; +import io.helidon.logging.common.LogConfig; import io.helidon.webserver.WebServer; import io.helidon.webserver.http.HttpRouting; @@ -32,6 +33,10 @@ private BasicMain() { * @param args ignored */ public static void main(String[] args) { + + // load logging configuration + LogConfig.configureRuntime(); + /* This would be the simplest possible server We do not use it, as we want testability diff --git a/examples/webserver/basic/src/main/resources/logging.properties b/examples/webserver/basic/src/main/resources/logging.properties index 161f6db0d..a177e3240 100644 --- a/examples/webserver/basic/src/main/resources/logging.properties +++ b/examples/webserver/basic/src/main/resources/logging.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2022, 2024 Oracle and/or its affiliates. +# Copyright (c) 2022, 2025 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,8 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # -handlers=java.util.logging.ConsoleHandler -java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %5$s%6$s%n + +handlers=io.helidon.logging.jul.HelidonConsoleHandler +java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %5$s%6$s%n +#java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %3$s !thread!: %5$s%6$s%n + # Global logging level. Can be overridden by specific loggers .level=INFO -io.helidon.webserver.level=INFO +io.helidon.level=INFO diff --git a/examples/webserver/observe/pom.xml b/examples/webserver/observe/pom.xml index ddcf5bd4e..2507d0ce5 100644 --- a/examples/webserver/observe/pom.xml +++ b/examples/webserver/observe/pom.xml @@ -71,6 +71,11 @@ io.helidon.config helidon-config-yaml + + io.helidon.logging + helidon-logging-jul + runtime + io.helidon.webserver.testing.junit5 helidon-webserver-testing-junit5 diff --git a/examples/webserver/observe/src/main/resources/logging.properties b/examples/webserver/observe/src/main/resources/logging.properties index 308e2fda1..9e867d31d 100644 --- a/examples/webserver/observe/src/main/resources/logging.properties +++ b/examples/webserver/observe/src/main/resources/logging.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2022, 2024 Oracle and/or its affiliates. +# Copyright (c) 2022, 2025 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,12 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. # -handlers=java.util.logging.ConsoleHandler -java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %5$s%6$s%n +handlers=io.helidon.logging.jul.HelidonConsoleHandler +java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %5$s%6$s%n +#java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %3$s !thread!: %5$s%6$s%n + # Global logging level. Can be overridden by specific loggers .level=INFO -io.helidon.webserve.level=INFO +io.helidon.level=INFO -java.util.logging.ConsoleHandler.level=ALL # to enable security audit logging for Helidon: # AUDIT.level=FINEST diff --git a/examples/webserver/protocols-custom/src/main/resources/logging.properties b/examples/webserver/protocols-custom/src/main/resources/logging.properties index bbfe53b28..132fc6bbe 100644 --- a/examples/webserver/protocols-custom/src/main/resources/logging.properties +++ b/examples/webserver/protocols-custom/src/main/resources/logging.properties @@ -13,10 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -handlers=java.util.logging.ConsoleHandler -java.util.logging.ConsoleHandler.level=ALL -java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %5$s%6$s%n + +handlers=io.helidon.logging.jul.HelidonConsoleHandler +java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %5$s%6$s%n +#java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %3$s !thread!: %5$s%6$s%n + # Global logging level. Can be overridden by specific loggers .level=INFO -io.helidon.webserver.level=INFO -# io.helidon.examples.webserver.sdp.level=FINE +io.helidon.level=INFO +#io.helidon.examples.webserver.sdp.level=FINE diff --git a/examples/webserver/protocols/pom.xml b/examples/webserver/protocols/pom.xml index cc62d3370..51930c39a 100644 --- a/examples/webserver/protocols/pom.xml +++ b/examples/webserver/protocols/pom.xml @@ -61,6 +61,11 @@ io.helidon.webserver helidon-webserver-http2 + + io.helidon.logging + helidon-logging-jul + runtime + org.junit.jupiter junit-jupiter-api diff --git a/examples/webserver/protocols/src/main/resources/logging.properties b/examples/webserver/protocols/src/main/resources/logging.properties index 161f6db0d..a177e3240 100644 --- a/examples/webserver/protocols/src/main/resources/logging.properties +++ b/examples/webserver/protocols/src/main/resources/logging.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2022, 2024 Oracle and/or its affiliates. +# Copyright (c) 2022, 2025 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,8 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # -handlers=java.util.logging.ConsoleHandler -java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %5$s%6$s%n + +handlers=io.helidon.logging.jul.HelidonConsoleHandler +java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %5$s%6$s%n +#java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %3$s !thread!: %5$s%6$s%n + # Global logging level. Can be overridden by specific loggers .level=INFO -io.helidon.webserver.level=INFO +io.helidon.level=INFO diff --git a/examples/webserver/tracing/src/main/resources/logging.properties b/examples/webserver/tracing/src/main/resources/logging.properties index 161f6db0d..a177e3240 100644 --- a/examples/webserver/tracing/src/main/resources/logging.properties +++ b/examples/webserver/tracing/src/main/resources/logging.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2022, 2024 Oracle and/or its affiliates. +# Copyright (c) 2022, 2025 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,8 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # -handlers=java.util.logging.ConsoleHandler -java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %5$s%6$s%n + +handlers=io.helidon.logging.jul.HelidonConsoleHandler +java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %5$s%6$s%n +#java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$s %3$s !thread!: %5$s%6$s%n + # Global logging level. Can be overridden by specific loggers .level=INFO -io.helidon.webserver.level=INFO +io.helidon.level=INFO From 6f351414afa538eced22dd9e926ec934c37dbc6f Mon Sep 17 00:00:00 2001 From: Jorge Bescos Gascon Date: Wed, 12 Feb 2025 18:10:22 +0100 Subject: [PATCH 2/2] 4.x: Fix Micronaut integration #8230 (#128) * 4.x: Fix Micronaut integration #8230 Signed-off-by: Jorge Bescos Gascon * remove hard coded version --------- Signed-off-by: Jorge Bescos Gascon Co-authored-by: tvallin --- examples/integrations/micronaut/data/pom.xml | 11 ++++++++++- .../micronaut/data/BeanValidationExceptionMapper.java | 5 ++--- .../integrations/micronaut/data/PetResource.java | 5 ++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/examples/integrations/micronaut/data/pom.xml b/examples/integrations/micronaut/data/pom.xml index f625d44f0..edd2bf726 100644 --- a/examples/integrations/micronaut/data/pom.xml +++ b/examples/integrations/micronaut/data/pom.xml @@ -49,6 +49,10 @@ io.micronaut micronaut-runtime + + io.micronaut.validation + micronaut-validation + io.helidon.logging helidon-logging-jul @@ -124,9 +128,14 @@ io.micronaut - micronaut-validation + micronaut-core-processor ${version.lib.micronaut} + + io.micronaut.validation + micronaut-validation-processor + ${version.lib.micronaut.validation} + io.micronaut.data micronaut-data-processor diff --git a/examples/integrations/micronaut/data/src/main/java/io/helidon/examples/integrations/micronaut/data/BeanValidationExceptionMapper.java b/examples/integrations/micronaut/data/src/main/java/io/helidon/examples/integrations/micronaut/data/BeanValidationExceptionMapper.java index 4d184c4bc..f6b25adcb 100644 --- a/examples/integrations/micronaut/data/src/main/java/io/helidon/examples/integrations/micronaut/data/BeanValidationExceptionMapper.java +++ b/examples/integrations/micronaut/data/src/main/java/io/helidon/examples/integrations/micronaut/data/BeanValidationExceptionMapper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2024 Oracle and/or its affiliates. + * Copyright (c) 2020, 2025 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,8 +16,7 @@ package io.helidon.examples.integrations.micronaut.data; -import javax.validation.ConstraintViolationException; - +import jakarta.validation.ConstraintViolationException; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.Provider; diff --git a/examples/integrations/micronaut/data/src/main/java/io/helidon/examples/integrations/micronaut/data/PetResource.java b/examples/integrations/micronaut/data/src/main/java/io/helidon/examples/integrations/micronaut/data/PetResource.java index a5fea526e..e90722d8e 100644 --- a/examples/integrations/micronaut/data/src/main/java/io/helidon/examples/integrations/micronaut/data/PetResource.java +++ b/examples/integrations/micronaut/data/src/main/java/io/helidon/examples/integrations/micronaut/data/PetResource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2024 Oracle and/or its affiliates. + * Copyright (c) 2020, 2025 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +16,10 @@ package io.helidon.examples.integrations.micronaut.data; -import javax.validation.constraints.Pattern; - import io.helidon.examples.integrations.micronaut.data.model.Pet; import jakarta.inject.Inject; +import jakarta.validation.constraints.Pattern; import jakarta.ws.rs.GET; import jakarta.ws.rs.NotFoundException; import jakarta.ws.rs.Path;