Modify logging

This commit is contained in:
Grzegorz Piwowarek 2016-08-13 13:41:55 +02:00
parent 2153e6d1a5
commit 28f1fe27e2
3 changed files with 8 additions and 3 deletions

View File

@ -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()));
}
}

View File

@ -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()));
}
}

View File

@ -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()));
}
}