Commit e2caf903 authored by Matt Tucker's avatar Matt Tucker Committed by matt

More logging.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@5930 b35dd754-fafc-0310-a699-88a17e54d16e
parent 9a7f0d7a
......@@ -11,10 +11,7 @@
package org.jivesoftware.wildfire;
import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.util.Log;
import org.jivesoftware.util.PropertyEventDispatcher;
import org.jivesoftware.util.PropertyEventListener;
import org.jivesoftware.util.*;
import org.jivesoftware.wildfire.net.SSLConfig;
import org.mortbay.jetty.Connector;
import org.mortbay.jetty.Server;
......@@ -143,8 +140,14 @@ public class HttpServerManager {
if (loadConnectors) {
Collection<Connector> connectors = createAdminConsoleConnectors(port, securePort);
if(connectors.size() == 0) {
if (connectors.size() == 0) {
adminServer = null;
// Log warning.
String warning = LocaleUtils.getLocalizedString("admin.console.warning");
Log.info(warning);
System.out.println(warning);
return;
}
......@@ -152,6 +155,40 @@ public class HttpServerManager {
adminServer.addConnector(connector);
}
}
// Log what ports the admin console is running on.
String listening = LocaleUtils.getLocalizedString("admin.console.listening");
boolean isPlainStarted = false;
boolean isSecureStarted = false;
for (Connector connector : adminServer.getConnectors()) {
if (connector.getPort() == port) {
isPlainStarted = true;
}
else if (connector.getPort() == securePort) {
isSecureStarted = true;
}
}
if (isPlainStarted && isSecureStarted) {
String msg = listening + ":" + System.getProperty("line.separator") +
" http://" + XMPPServer.getInstance().getServerInfo().getName() + ":" +
port + System.getProperty("line.separator") +
" https://" + XMPPServer.getInstance().getServerInfo().getName() + ":" +
securePort;
Log.info(msg);
System.out.println(msg);
}
else if (isSecureStarted) {
Log.info(listening + " https://" +
XMPPServer.getInstance().getServerInfo().getName() + ":" + securePort);
System.out.println(listening + " https://" +
XMPPServer.getInstance().getServerInfo().getName() + ":" + securePort);
}
else if (isPlainStarted) {
Log.info(listening + " http://" +
XMPPServer.getInstance().getServerInfo().getName() + ":" + port);
System.out.println(listening + " http://" +
XMPPServer.getInstance().getServerInfo().getName() + ":" + port);
}
}
private boolean checkPorts(int [] httpBindPorts, int [] adminConsolePorts) {
......@@ -161,10 +198,10 @@ public class HttpServerManager {
}
public void startup() {
if(httpBindContext != null && isHttpBindServiceEnabled()) {
if (httpBindContext != null && isHttpBindServiceEnabled()) {
createHttpBindServer();
}
if(adminConsoleContext != null) {
if (adminConsoleContext != null) {
createAdminConsoleServer();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment