diff --git a/spring-boot-modules/spring-boot-xml/src/main/java/com/baeldung/springbootxml/SpringBootXmlApplication.java b/spring-boot-modules/spring-boot-xml/src/main/java/com/baeldung/springbootxml/SpringBootXmlApplication.java index bd75a95d7d..addf24c427 100644 --- a/spring-boot-modules/spring-boot-xml/src/main/java/com/baeldung/springbootxml/SpringBootXmlApplication.java +++ b/spring-boot-modules/spring-boot-xml/src/main/java/com/baeldung/springbootxml/SpringBootXmlApplication.java @@ -1,15 +1,21 @@ package com.baeldung.springbootxml; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ImportResource; -@SpringBootApplication +@Configuration +@EnableAutoConfiguration @ImportResource("classpath:beans.xml") public class SpringBootXmlApplication implements CommandLineRunner { + private static final Logger logger = LoggerFactory.getLogger(SpringBootXmlApplication.class); + @Autowired private Pojo pojo; public static void main(String[] args) { @@ -17,7 +23,7 @@ public class SpringBootXmlApplication implements CommandLineRunner { } public void run(String... args) { - System.out.println(pojo.getField()); + logger.info(pojo.getField()); } } diff --git a/spring-boot-modules/spring-boot-xml/src/main/resources/beans.xml b/spring-boot-modules/spring-boot-xml/src/main/resources/beans.xml index 9dac0d9e65..200afecbc9 100644 --- a/spring-boot-modules/spring-boot-xml/src/main/resources/beans.xml +++ b/spring-boot-modules/spring-boot-xml/src/main/resources/beans.xml @@ -1,11 +1,9 @@ - +