[Pulsar Proxy] Add error log for pulsar proxy starter
### Motivation
Currently, the proxy service starter will throw all exceptions to the main method directly, it's hard to check the error log if there is an exception when proxy service start.
### Modifications
Add try-catch for proxy start method.
@@ -25,6 +25,7 @@ import static org.apache.pulsar.common.stats.JvmMetrics.getJvmDirectMemoryUsed;
import static org.slf4j.bridge.SLF4JBridgeHandler.install;
import static org.slf4j.bridge.SLF4JBridgeHandler.removeHandlersForRootLogger;
+import org.apache.pulsar.broker.PulsarServerException;
import org.apache.pulsar.broker.authentication.AuthenticationService;
import org.apache.pulsar.common.configuration.PulsarConfigurationLoader;
import org.apache.pulsar.proxy.server.plugin.servlet.ProxyAdditionalServletWithClassLoader;
@@ -76,6 +77,8 @@ public class ProxyServiceStarter {
private boolean help = false;
public ProxyServiceStarter(String[] args) throws Exception {
+ try {
+
// setup handlers
removeHandlersForRootLogger();
install();
@@ -167,6 +170,11 @@ public class ProxyServiceStarter {
// start web-service
server.start();
+
+ } catch (Exception e) {
+ log.error("Failed to start pulsar proxy service. error msg " + e.getMessage(), e);
+ throw new PulsarServerException(e);
+ }
}
public static void main(String[] args) throws Exception {
