This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 7c996b4fb60e8a3f56f5f35cd13fd89e3c20def7
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Fri Jan 29 11:42:56 2021 +0100

    CAMEL-16072: camel-main - be less verbose in summary off mode
---
 .../org/apache/camel/impl/engine/AbstractCamelContext.java | 14 ++++++++------
 .../main/java/org/apache/camel/main/BaseMainSupport.java   | 11 ++++++++---
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git 
a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java
 
b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java
index a7c0cbc..04e225e 100644
--- 
a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java
+++ 
b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java
@@ -3147,12 +3147,14 @@ public abstract class AbstractCamelContext extends 
BaseService
     protected void doStop() throws Exception {
         stopWatch.restart();
 
-        if (shutdownStrategy != null && shutdownStrategy.getTimeUnit() != 
null) {
-            long timeout = 
shutdownStrategy.getTimeUnit().toMillis(shutdownStrategy.getTimeout());
-            String to = TimeUtils.printDuration(timeout);
-            LOG.info("Apache Camel {} ({}) shutting down (timeout:{})", 
getVersion(), getName(), to);
-        } else {
-            LOG.info("Apache Camel {} ({}) shutting down", getVersion(), 
getName());
+        if (startupSummaryLevel != StartupSummaryLevel.Off) {
+            if (shutdownStrategy != null && shutdownStrategy.getTimeUnit() != 
null) {
+                long timeout = 
shutdownStrategy.getTimeUnit().toMillis(shutdownStrategy.getTimeout());
+                String to = TimeUtils.printDuration(timeout);
+                LOG.info("Apache Camel {} ({}) shutting down (timeout:{})", 
getVersion(), getName(), to);
+            } else {
+                LOG.info("Apache Camel {} ({}) shutting down", getVersion(), 
getName());
+            }
         }
 
         EventHelper.notifyCamelContextStopping(this);
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java 
b/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
index 0bbc281..a8a79e7 100644
--- a/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
+++ b/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
@@ -738,7 +738,8 @@ public abstract class BaseMainSupport extends BaseService {
         if (!beansProperties.isEmpty()) {
             LOG.debug("Creating and binding beans to registry from loaded 
properties: {}", beansProperties.size());
             bindBeansToRegistry(camelContext, beansProperties, "camel.beans.",
-                    mainConfigurationProperties.isAutoConfigurationFailFast(), 
true, autoConfiguredProperties);
+                    mainConfigurationProperties.isAutoConfigurationFailFast(),
+                    
mainConfigurationProperties.isAutoConfigurationLogSummary(), true, 
autoConfiguredProperties);
         }
         if (!contextProperties.isEmpty()) {
             LOG.debug("Auto-configuring CamelContext from loaded properties: 
{}", contextProperties.size());
@@ -986,7 +987,7 @@ public abstract class BaseMainSupport extends BaseService {
 
     private void bindBeansToRegistry(
             CamelContext camelContext, Map<String, Object> properties,
-            String optionPrefix, boolean failIfNotSet, boolean ignoreCase,
+            String optionPrefix, boolean failIfNotSet, boolean logSummary, 
boolean ignoreCase,
             Map<String, String> autoConfiguredProperties)
             throws Exception {
 
@@ -1006,7 +1007,11 @@ public abstract class BaseMainSupport extends 
BaseService {
                             "Cannot create/resolve bean with name " + name + " 
from value: " + value);
                 }
                 // register bean
-                LOG.info("Binding bean: {} (type: {}) to the registry", key, 
ObjectHelper.classCanonicalName(bean));
+                if (logSummary) {
+                    LOG.info("Binding bean: {} (type: {}) to the registry", 
key, ObjectHelper.classCanonicalName(bean));
+                } else {
+                    LOG.debug("Binding bean: {} (type: {}) to the registry", 
key, ObjectHelper.classCanonicalName(bean));
+                }
                 camelContext.getRegistry().bind(name, bean);
             }
         }

Reply via email to