Always set helma.logdir when using helma logging, even when

logdir is set to console.
Disable checkRunning() because of connection timeout problems.
This commit is contained in:
hns 2003-12-12 11:36:26 +00:00
parent 01a7123cac
commit fb7c48416d

View file

@ -591,23 +591,26 @@ public class Server implements IPathElement, Runnable {
*/ */
public static Log getLogger() { public static Log getLogger() {
if (logger == null) { if (logger == null) {
// get the logDir property if (helmaLogging) {
// set up system properties for helma.util.Logging
String logDir = sysProps.getProperty("logdir", "log"); String logDir = sysProps.getProperty("logdir", "log");
if ("console".equals(logDir)) { if (!"console".equals(logDir)) {
logger = Logging.getConsoleLog(); // try to get the absolute logdir path
} else {
if (helmaLogging) {
// set up helma.logdir system property // set up helma.logdir system property
File dir = new File(logDir); File dir = new File(logDir);
if (!dir.isAbsolute()) { if (!dir.isAbsolute()) {
dir = new File(hopHome, logDir); dir = new File(hopHome, logDir);
} }
System.setProperty("helma.logdir", dir.getAbsolutePath());
logDir = dir.getAbsolutePath();
}
System.setProperty("helma.logdir", logDir);
} }
logger = LogFactory.getLog("helma.server"); logger = LogFactory.getLog("helma.server");
} }
}
return logger; return logger;
} }
@ -636,6 +639,11 @@ public class Server implements IPathElement, Runnable {
* A primitive method to check whether a server is already running on our port. * A primitive method to check whether a server is already running on our port.
*/ */
private void checkRunning(InetAddrPort addrPort) throws Exception { private void checkRunning(InetAddrPort addrPort) throws Exception {
// checkRunning is disabled until we find a fix for the socket creation
// timeout problems reported on the list.
return;
/*
InetAddress addr = addrPort.getInetAddress(); InetAddress addr = addrPort.getInetAddress();
if (addr == null) { if (addr == null) {
try { try {
@ -655,6 +663,7 @@ public class Server implements IPathElement, Runnable {
// if we got so far, another server is already running on this port and db // if we got so far, another server is already running on this port and db
throw new Exception("Error: Server already running on this port: " + addrPort); throw new Exception("Error: Server already running on this port: " + addrPort);
*/
} }
/** /**