diff --git a/spring-all/src/main/java/org/baeldung/startup/StartupApplicationListenerExample.java b/spring-all/src/main/java/org/baeldung/startup/StartupApplicationListenerExample.java index 1c784e0c74..32a63f0c1a 100644 --- a/spring-all/src/main/java/org/baeldung/startup/StartupApplicationListenerExample.java +++ b/spring-all/src/main/java/org/baeldung/startup/StartupApplicationListenerExample.java @@ -1,5 +1,6 @@ package org.baeldung.startup; +import org.apache.log4j.Logger; import org.springframework.context.ApplicationListener; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.stereotype.Component; @@ -7,10 +8,13 @@ import org.springframework.stereotype.Component; @Component public class StartupApplicationListenerExample implements ApplicationListener { + private static final Logger LOG = Logger.getLogger(StartupApplicationListenerExample.class); + public static int counter; @Override public void onApplicationEvent(ContextRefreshedEvent event) { + LOG.info("Increment counter"); counter++; } }