Skip to content

Commit

Permalink
Added additional logging
Browse files Browse the repository at this point in the history
  • Loading branch information
rijnb committed Sep 26, 2020
1 parent 1843fa6 commit c554d6d
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,12 @@ self-hosting this service.

## Release Notes

###

* Improved README.md.

* Added reason for failure at startup in log file.

### 2.4.14.0-2.4.14.1

* Updated dependencies for security vulnerabilities.
Expand Down
2 changes: 1 addition & 1 deletion deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>com.mapcode</groupId>
<artifactId>mapcode-rest-service</artifactId>
<version>2.4.14.1</version>
<version>2.4.14.2</version>
</parent>

<artifactId>deployment</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public final class StartupCheck {
*/

// Check if we are using the correct JDK.
LOG.info("check: Checking system start-up configuration.");
final String javaVersion = System.getProperty("java.version");
check(javaVersion.startsWith("1.6.") || javaVersion.startsWith("1.7.") || javaVersion.startsWith("1.8."),
"The system requires JRE 1.6.x, 1.7.x or 1.8.x (found JRE " + javaVersion + ").");
Expand All @@ -69,9 +70,12 @@ public final class StartupCheck {
" Current value=" + Charset.defaultCharset().name());

// Start JMX server.
LOG.info("check: Get JMX agent.");
final SystemMetricsAgent jmxAgent = injector.getInstance(SystemMetricsAgent.class);

//noinspection OverlyBroadCatchBlock
try {
LOG.info("check: Register JMX agent.");
jmxAgent.register();
}
catch (final Exception e) {
Expand Down Expand Up @@ -99,7 +103,7 @@ private static void check(final boolean check, @Nonnull final String reason) {
System.err.println("Reason: " + reason);
System.err.println("=======================================");
System.err.println();
throw new IllegalStateException("System did NOT start successfully.");
throw new IllegalStateException("System did NOT start successfully. Reason: " + reason);
}
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<artifactId>mapcode-rest-service</artifactId>

<packaging>pom</packaging>
<version>2.4.14.1</version>
<version>2.4.14.2</version>

<name>Mapcode REST API Web Service</name>
<description>
Expand Down
2 changes: 1 addition & 1 deletion resources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>com.mapcode</groupId>
<artifactId>mapcode-rest-service</artifactId>
<version>2.4.14.1</version>
<version>2.4.14.2</version>
</parent>

<artifactId>resources</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>com.mapcode</groupId>
<artifactId>mapcode-rest-service</artifactId>
<version>2.4.14.1</version>
<version>2.4.14.2</version>
</parent>

<artifactId>service</artifactId>
Expand Down

0 comments on commit c554d6d

Please sign in to comment.