From 28f1fe27e2359cb4b2f8dbf36f57eacfb25b98d0 Mon Sep 17 00:00:00 2001 From: Grzegorz Piwowarek Date: Sat, 13 Aug 2016 13:41:55 +0200 Subject: [PATCH] Modify logging --- .../org/baeldung/startup/InitializingBeanExampleBean.java | 4 +++- .../org/baeldung/startup/LogicInConstructorExampleBean.java | 4 +++- .../java/org/baeldung/startup/PostConstructExampleBean.java | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/spring-all/src/main/java/org/baeldung/startup/InitializingBeanExampleBean.java b/spring-all/src/main/java/org/baeldung/startup/InitializingBeanExampleBean.java index 8d4f04e1ad..33b14864f3 100644 --- a/spring-all/src/main/java/org/baeldung/startup/InitializingBeanExampleBean.java +++ b/spring-all/src/main/java/org/baeldung/startup/InitializingBeanExampleBean.java @@ -7,6 +7,8 @@ import org.springframework.context.annotation.Scope; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; +import java.util.Arrays; + @Component @Scope(value = "prototype") public class InitializingBeanExampleBean implements InitializingBean { @@ -18,6 +20,6 @@ public class InitializingBeanExampleBean implements InitializingBean { @Override public void afterPropertiesSet() throws Exception { - LOG.info(environment); + LOG.info(Arrays.asList(environment.getDefaultProfiles())); } } diff --git a/spring-all/src/main/java/org/baeldung/startup/LogicInConstructorExampleBean.java b/spring-all/src/main/java/org/baeldung/startup/LogicInConstructorExampleBean.java index 3cef105c3c..2a7b3e26c7 100644 --- a/spring-all/src/main/java/org/baeldung/startup/LogicInConstructorExampleBean.java +++ b/spring-all/src/main/java/org/baeldung/startup/LogicInConstructorExampleBean.java @@ -6,6 +6,8 @@ import org.springframework.context.annotation.Scope; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; +import java.util.Arrays; + @Component @Scope(value = "prototype") public class LogicInConstructorExampleBean { @@ -18,6 +20,6 @@ public class LogicInConstructorExampleBean { public LogicInConstructorExampleBean(Environment environment) { this.environment = environment; - LOG.info(environment); + LOG.info(Arrays.asList(environment.getDefaultProfiles())); } } diff --git a/spring-all/src/main/java/org/baeldung/startup/PostConstructExampleBean.java b/spring-all/src/main/java/org/baeldung/startup/PostConstructExampleBean.java index be21aef70c..4cabaad4df 100644 --- a/spring-all/src/main/java/org/baeldung/startup/PostConstructExampleBean.java +++ b/spring-all/src/main/java/org/baeldung/startup/PostConstructExampleBean.java @@ -7,6 +7,7 @@ import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; +import java.util.Arrays; @Component @Scope(value = "prototype") @@ -19,6 +20,6 @@ public class PostConstructExampleBean { @PostConstruct public void init() { - LOG.info(environment); + LOG.info(Arrays.asList(environment.getDefaultProfiles())); } }