Skip to content

Commit

Permalink
chore: log openrouteservice version and build date (#1595)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelsJP authored Nov 3, 2023
2 parents 3121550 + 37e3de9 commit 78f99d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ors-api/src/main/java/org/heigit/ors/api/Application.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package org.heigit.ors.api;

import jakarta.servlet.ServletContextListener;
import org.apache.log4j.Logger;
import org.heigit.ors.api.servlet.listeners.ORSInitContextListener;
import org.heigit.ors.api.util.AppInfo;
import org.heigit.ors.routing.RoutingProfileManagerStatus;
import org.heigit.ors.util.StringUtility;
import org.springframework.boot.SpringApplication;
Expand All @@ -14,6 +16,7 @@
@ServletComponentScan("org.heigit.ors.api.servlet.listeners")
@SpringBootApplication
public class Application extends SpringBootServletInitializer {
private static final Logger LOG = Logger.getLogger(Application.class.getName());

static {
System.setProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager");
Expand All @@ -24,6 +27,7 @@ public static void main(String[] args) {
System.setProperty(ORSEnvironmentPostProcessor.ORS_CONFIG_LOCATION_PROPERTY, args[0]);
}
SpringApplication.run(Application.class, args);
LOG.info("openrouteservice %s".formatted(AppInfo.getEngineInfo()));
if (RoutingProfileManagerStatus.hasFailed()) {
System.exit(1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.juli.logging.LogFactory;
import org.apache.log4j.Logger;
import org.heigit.ors.api.EngineProperties;
import org.heigit.ors.api.util.AppInfo;
import org.heigit.ors.config.EngineConfig;
import org.heigit.ors.isochrones.statistics.StatisticsProviderFactory;
import org.heigit.ors.routing.RoutingProfileManager;
Expand Down Expand Up @@ -77,7 +78,7 @@ public void contextInitialized(ServletContextEvent contextEvent) {
@Override
public void contextDestroyed(ServletContextEvent contextEvent) {
try {
LOGGER.info("Shutting down ORS and releasing resources.");
LOGGER.info("Shutting down openrouteservice %s and releasing resources.".formatted(AppInfo.getEngineInfo()));
FormatUtility.unload();
if (RoutingProfileManagerStatus.isReady())
RoutingProfileManager.getInstance().destroy();
Expand Down

0 comments on commit 78f99d4

Please sign in to comment.