[Minor] Log how long Agent needs to start

This commit is contained in:
Robert von Burg 2017-09-08 14:16:30 +02:00
parent 67e02de24b
commit 5315be28c6
1 changed files with 4 additions and 1 deletions

View File

@ -11,6 +11,7 @@ import org.slf4j.LoggerFactory;
import li.strolch.agent.api.StrolchAgent; import li.strolch.agent.api.StrolchAgent;
import li.strolch.agent.api.StrolchBootstrapper; import li.strolch.agent.api.StrolchBootstrapper;
import li.strolch.utils.helper.StringHelper;
@WebListener @WebListener
public class StartupListener implements ServletContextListener { public class StartupListener implements ServletContextListener {
@ -23,6 +24,7 @@ public class StartupListener implements ServletContextListener {
public void contextInitialized(ServletContextEvent sce) { public void contextInitialized(ServletContextEvent sce) {
logger.info("Starting Bookshop..."); logger.info("Starting Bookshop...");
long start = System.currentTimeMillis();
try { try {
// we load the configuration by reading the boot strap file: // we load the configuration by reading the boot strap file:
String boostrapFileName = "/WEB-INF/" + StrolchBootstrapper.FILE_BOOTSTRAP; String boostrapFileName = "/WEB-INF/" + StrolchBootstrapper.FILE_BOOTSTRAP;
@ -39,7 +41,8 @@ public class StartupListener implements ServletContextListener {
throw e; throw e;
} }
logger.info("Started Bookshop."); long took = System.currentTimeMillis() - start;
logger.info("Started Bookshop in " + (StringHelper.formatMillisecondsDuration(took)));
} }
@Override @Override