mardi 17 mars 2015

Print application banner when Spring Context starts

I'm trying to implement an application Banner that prints the version and other information when our application starts. I have tried implementing SmartLifecycle and ApplicationListener without success.


The callback method never gets called and the banner never prints. What am I doing wrong?



public class Banner implements ApplicationListener<ContextStartedEvent>
{
private static final Logger log = LoggerFactory.getLogger(Banner.class);

@Override
public void onApplicationEvent(ContextStartedEvent event)
{
log.info("*******************************************************");
log.info("Application v1.8 starting");
log.info("*******************************************************");
}
}

Aucun commentaire:

Enregistrer un commentaire