From c75211d2936627d562d761d65d75ea41dc5c2164 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Wed, 4 Sep 2024 16:46:03 +0200 Subject: [PATCH] Reduce Agroal pool logging In Quarkus LangChain4j, we ended up with log entries like: 2024-09-04 15:59:04,507 INFO [io.agr.pool] (executor-thread-1) Datasource '': Pool interceptors: [io.quarkiverse.langchain4j.pgvector.PgVectorAgroalPoolInterceptor_X57UyAR6Zcr9HEqaFpEAQVtGhO8_Synthetic_ClientProxy@762e5bc7 (priority 0)] It's not something the user should be bothered with. --- .../java/io/quarkus/agroal/deployment/AgroalProcessor.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/extensions/agroal/deployment/src/main/java/io/quarkus/agroal/deployment/AgroalProcessor.java b/extensions/agroal/deployment/src/main/java/io/quarkus/agroal/deployment/AgroalProcessor.java index dd17a2b487338..ae4f74b82faf1 100644 --- a/extensions/agroal/deployment/src/main/java/io/quarkus/agroal/deployment/AgroalProcessor.java +++ b/extensions/agroal/deployment/src/main/java/io/quarkus/agroal/deployment/AgroalProcessor.java @@ -10,6 +10,7 @@ import java.util.Map.Entry; import java.util.Optional; import java.util.Set; +import java.util.logging.Level; import java.util.stream.Collectors; import javax.sql.XADataSource; @@ -55,6 +56,7 @@ import io.quarkus.deployment.annotations.Record; import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem; import io.quarkus.deployment.builditem.FeatureBuildItem; +import io.quarkus.deployment.builditem.LogCategoryBuildItem; import io.quarkus.deployment.builditem.RemovedResourceBuildItem; import io.quarkus.deployment.builditem.SslNativeConfigBuildItem; import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem; @@ -421,4 +423,9 @@ void registerRowSetSupport( "com.sun.rowset.providers.RIOptimisticProvider", "com.sun.rowset.providers.RIXMLProvider").build()); } + + @BuildStep + void reduceLogging(BuildProducer logCategories) { + logCategories.produce(new LogCategoryBuildItem("io.agroal.pool", Level.WARNING)); + } }