mirror of
https://gitee.com/dromara/MaxKey.git
synced 2026-06-12 13:51:05 +08:00
WebContext.getServerPort
This commit is contained in:
@@ -150,6 +150,10 @@ public final class WebContext {
|
||||
public static String getProperty(String key) {
|
||||
return properties.getProperty(key);
|
||||
}
|
||||
|
||||
public static String getServerPort() {
|
||||
return getProperty("server.port");
|
||||
}
|
||||
|
||||
// below method is common HttpServlet method
|
||||
/**
|
||||
|
||||
@@ -48,7 +48,7 @@ public class MaxKeyApplication extends SpringBootServletInitializer {
|
||||
new InitializeContext(applicationContext).init();
|
||||
|
||||
_logger.info("MaxKey at {}" , new DateTime());
|
||||
_logger.info("MaxKey Server Port {}" , WebContext.getProperty("server.port"));
|
||||
_logger.info("MaxKey Server Port {}" , WebContext.getServerPort());
|
||||
_logger.info("MaxKey started.");
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ public class MaxKeyMgtApplication extends SpringBootServletInitializer {
|
||||
new InitializeContext(applicationContext).init();
|
||||
|
||||
_logger.info("MaxKeyMgt at {}" , new DateTime());
|
||||
_logger.info("MaxKeyMgt Server Port {}" , WebContext.getProperty("server.port"));
|
||||
_logger.info("MaxKeyMgt Server Port {}" , WebContext.getServerPort());
|
||||
_logger.info("MaxKeyMgt started.");
|
||||
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class MaxKeyOpenApiApplication extends SpringBootServletInitializer {
|
||||
new InitializeContext(applicationContext).init();
|
||||
|
||||
_logger.info("MaxKey OpenApi at {}" , new DateTime());
|
||||
_logger.info("MaxKey OpenApi Server Port {}" , WebContext.getProperty("server.port"));
|
||||
_logger.info("MaxKey OpenApi Server Port {}" , WebContext.getServerPort());
|
||||
_logger.info("MaxKey OpenApi started.");
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user