You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by rc...@apache.org on 2021/01/29 03:09:04 UTC

[james-project] 04/13: JAMES-3493 Add logs for start and stop of the JAMES and the JMX servers

This is an automated email from the ASF dual-hosted git repository.

rcordier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 61850385e475fa75f948001a6ba361ed30edc859
Author: Rene Cordier <rc...@linagora.com>
AuthorDate: Wed Jan 27 10:18:54 2021 +0700

    JAMES-3493 Add logs for start and stop of the JAMES and the JMX servers
---
 .../src/main/java/org/apache/james/GuiceJamesServer.java            | 2 ++
 .../src/main/java/org/apache/james/modules/server/JMXServer.java    | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
index f149796..36ebe4a 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
@@ -93,6 +93,7 @@ public class GuiceJamesServer {
             injector.getInstance(InitializationOperations.class).initModules();
             guiceProbeProvider = injector.getInstance(GuiceProbeProvider.class);
             isStartedProbe.notifyStarted();
+            LOGGER.info("JAMES server started");
         } catch (Throwable e) {
             LOGGER.error("Fatal error while starting James", e);
             throw e;
@@ -104,6 +105,7 @@ public class GuiceJamesServer {
         if (preDestroy != null) {
             preDestroy.stage();
         }
+        LOGGER.info("JAMES server stopped");
     }
 
     public boolean isStarted() {
diff --git a/server/container/guice/jmx/src/main/java/org/apache/james/modules/server/JMXServer.java b/server/container/guice/jmx/src/main/java/org/apache/james/modules/server/JMXServer.java
index aa51ec2..e1ffb3c 100644
--- a/server/container/guice/jmx/src/main/java/org/apache/james/modules/server/JMXServer.java
+++ b/server/container/guice/jmx/src/main/java/org/apache/james/modules/server/JMXServer.java
@@ -36,11 +36,15 @@ import javax.management.remote.JMXServiceURL;
 
 import org.apache.james.lifecycle.api.Startable;
 import org.apache.james.util.RestrictingRMISocketFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.github.fge.lambdas.Throwing;
 import com.google.common.collect.ImmutableMap;
 
 public class JMXServer implements Startable {
+    private static final Logger LOGGER = LoggerFactory.getLogger(JMXServer.class);
+
     private final JmxConfiguration jmxConfiguration;
     private final Set<String> registeredKeys;
     private final Object lock;
@@ -101,6 +105,7 @@ public class JMXServer implements Startable {
                 ManagementFactory.getPlatformMBeanServer());
 
             jmxConnectorServer.start();
+            LOGGER.info("JMX server started");
         } catch (Exception e) {
             throw new RuntimeException(e);
         }
@@ -115,6 +120,7 @@ public class JMXServer implements Startable {
             restrictingRMISocketFactory.getSockets()
                 .forEach(Throwing.consumer(ServerSocket::close)
                     .sneakyThrow());
+            LOGGER.info("JMX server stopped");
         } catch (Exception e) {
             throw new RuntimeException(e);
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org