Commit 791720c5 authored by legoc's avatar legoc
Browse files

Merge branch 'master' into responder-timeout

parents 0b09034f 15ba286c
......@@ -13,7 +13,7 @@
<dependency>
<groupId>fr.ill.ics</groupId>
<artifactId>cameo-server</artifactId>
<version>0.1.5</version>
<version>0.1.6</version>
<exclusions>
<exclusion>
<groupId>fr.ill.ics</groupId>
......
......@@ -162,11 +162,19 @@ public final class ConfigManager {
}
public void setHost(String host) {
// If host is provided, set it.
if (host == null) {
try {
// Otherwise try to get the hostname.
this.host = InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e) {
this.host = "localhost";
try {
// Otherwise try to get the IP address.
this.host = InetAddress.getLocalHost().getHostAddress();
} catch (UnknownHostException e2) {
// Otherwise set localhost.
this.host = "localhost";
}
}
} else {
this.host = host;
......
......@@ -62,10 +62,10 @@ public final class LogInfo {
if (!logDirectory.exists()) {
logDirectory.mkdir();
}
FileHandler fileHandler = new FileHandler(ConfigManager.getInstance().getLogPath() + "/cameo.log", false);
fileHandler.setFormatter(new LogFormatter());
fileHandler.setLevel(Level.FINE);
fileHandler.setLevel(Level.INFO);
logger.addHandler(fileHandler);
if (ConfigManager.getInstance().isDebugMode()) {
......
......@@ -59,7 +59,7 @@ public class Manager extends ConfigLoader {
public Manager(String xmlPath) {
super(xmlPath);
LogInfo.getInstance().init();
LogInfo.getInstance().getLogger().fine("Endpoint is " + ConfigManager.getInstance().getHostEndpoint());
LogInfo.getInstance().getLogger().info("Endpoint is " + ConfigManager.getInstance().getHostEndpoint());
showApplicationConfigs();
......@@ -76,7 +76,7 @@ public class Manager extends ConfigLoader {
public Manager(InputStream configStream) {
super(configStream);
LogInfo.getInstance().init();
LogInfo.getInstance().getLogger().fine("Endpoint is " + ConfigManager.getInstance().getHostEndpoint());
LogInfo.getInstance().getLogger().info("Endpoint is " + ConfigManager.getInstance().getHostEndpoint());
showApplicationConfigs();
......
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