Skip to content

Commit ff2c48a

Browse files
committed
at startup, log the profile we are running in
it might help debugging when necessary
1 parent a88b569 commit ff2c48a

4 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/main/java/de/rwth/idsg/steve/Application.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import static de.rwth.idsg.steve.SteveConfiguration.DB;
1414
import static de.rwth.idsg.steve.SteveConfiguration.Jetty;
1515
import static de.rwth.idsg.steve.SteveConfiguration.Ocpp;
16+
import static de.rwth.idsg.steve.SteveConfiguration.PROFILE;
1617
import static de.rwth.idsg.steve.SteveConfiguration.STEVE_VERSION;
1718

1819
/**
@@ -33,6 +34,8 @@ public static void main(String[] args) throws IOException {
3334

3435
loadProperties();
3536

37+
log.info("Loaded the properties. Starting with the '{}' profile", PROFILE);
38+
3639
JettyServer jettyServer = new JettyServer();
3740
jettyServer.start();
3841
}
@@ -41,6 +44,7 @@ private static void loadProperties() throws IOException {
4144
PropertiesFileLoader prop = new PropertiesFileLoader("main.properties");
4245

4346
STEVE_VERSION = prop.getString("steve.version");
47+
PROFILE = prop.getString("profile");
4448

4549
DB.IP = prop.getString("db.ip");
4650
DB.PORT = prop.getInt("db.port");

src/main/java/de/rwth/idsg/steve/SteveConfiguration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ private SteveConfiguration() { }
2525
// -------------------------------------------------------------------------
2626

2727
public static String STEVE_VERSION;
28+
public static String PROFILE;
2829

2930
/**
3031
* Jetty configuration

src/main/resources/config/dev/main.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ ws.session.select.strategy = ALWAYS_LAST
3636
### DO NOT MODIFY ###
3737
steve.version = ${project.version}
3838
db.sql.logging = true
39+
profile = dev

src/main/resources/config/prod/main.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ ws.session.select.strategy = ALWAYS_LAST
3636
### DO NOT MODIFY ###
3737
steve.version = ${project.version}
3838
db.sql.logging = false
39+
profile = prod

0 commit comments

Comments
 (0)