From 894450bb0bc4193c2c59f04c991c1414d3fd0d3f Mon Sep 17 00:00:00 2001 From: Yanming Zhou Date: Fri, 31 May 2024 16:39:34 +0800 Subject: [PATCH] Add `org.hibernate.orm.jdbc.bind` to `sql` logging group It's reasonable to treat prepared statement parameters as part of sql. See https://github.com/spring-projects/spring-boot/issues/36640#issuecomment-1657394103 --- .../docs/antora/modules/reference/pages/features/logging.adoc | 2 +- .../boot/context/logging/LoggingApplicationListener.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/features/logging.adoc b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/features/logging.adoc index 746f25c6feec..66a36d7aa32a 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/features/logging.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/features/logging.adoc @@ -254,7 +254,7 @@ Spring Boot includes the following pre-defined logging groups that can be used o | `org.springframework.core.codec`, `org.springframework.http`, `org.springframework.web`, `org.springframework.boot.actuate.endpoint.web`, `org.springframework.boot.web.servlet.ServletContextInitializerBeans` | sql -| `org.springframework.jdbc.core`, `org.hibernate.SQL`, `org.jooq.tools.LoggerListener` +| `org.springframework.jdbc.core`, `org.hibernate.SQL`, `org.hibernate.orm.jdbc.bind`, `org.jooq.tools.LoggerListener` |=== diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/logging/LoggingApplicationListener.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/logging/LoggingApplicationListener.java index 1f0d496ddc74..67c07d566f3c 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/logging/LoggingApplicationListener.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/logging/LoggingApplicationListener.java @@ -153,6 +153,7 @@ public class LoggingApplicationListener implements GenericApplicationListener { loggers.add("web", "org.springframework.boot.web.servlet.ServletContextInitializerBeans"); loggers.add("sql", "org.springframework.jdbc.core"); loggers.add("sql", "org.hibernate.SQL"); + loggers.add("sql", "org.hibernate.orm.jdbc.bind"); loggers.add("sql", "org.jooq.tools.LoggerListener"); DEFAULT_GROUP_LOGGERS = Collections.unmodifiableMap(loggers); }