Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

*) passing homepath to serverLog.configureLogging

thelib30e64daab7b
diff --git a/source/de/anomic/server/logging/serverLog.java b/source/de/anomic/server/logging/serverLog.java
index 406ff22ee..78aba4b81 100644
--- a/source/de/anomic/server/logging/serverLog.java
+++ b/source/de/anomic/server/logging/serverLog.java
@@ -45,6 +45,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
+import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.LogManager;
import java.util.logging.Logger;
@@ -186,7 +187,7 @@ public final class serverLog {
Logger.getLogger(appName).isLoggable(Level.FINEST);
}
- public static final void configureLogging(File loggingConfigFile) throws SecurityException, FileNotFoundException, IOException {
+ public static final void configureLogging(String homePath, File loggingConfigFile) throws SecurityException, FileNotFoundException, IOException {
FileInputStream fileIn = null;
try {
System.out.println("STARTUP: Trying to load logging configuration from file " + loggingConfigFile.toString());
@@ -197,9 +198,11 @@ public final class serverLog {
logManager.readConfiguration(fileIn);
// creating the logging directory
- File log = new File("./DATA/LOG/");
+ File log = new File(homePath,"./DATA/LOG/");
if(!log.canRead()) log.mkdir();
+ // TODO: changing the pattern settings for the file handlers
+
// generating the root logger
/*Logger logger =*/ Logger.getLogger("");
diff --git a/source/yacy.java b/source/yacy.java
index 6d3d8dd6b..9a413fc86 100644
--- a/source/yacy.java
+++ b/source/yacy.java
@@ -244,7 +244,7 @@ public final class yacy {
System.out.println("could not copy yacy.logging");
}
try{
- serverLog.configureLogging(new File(homePath, "DATA/LOG/yacy.logging"));
+ serverLog.configureLogging(homePath,new File(homePath, "DATA/LOG/yacy.logging"));
} catch (IOException e) {
System.out.println("could not find logging properties in homePath=" + homePath);
e.printStackTrace();
@@ -666,7 +666,7 @@ public final class yacy {
*/
public static void minimizeUrlDB(String homePath) {
// run with "java -classpath classes yacy -minimizeUrlDB"
- try {serverLog.configureLogging(new File(homePath, "DATA/LOG/yacy.logging"));} catch (Exception e) {}
+ try {serverLog.configureLogging(homePath,new File(homePath, "DATA/LOG/yacy.logging"));} catch (Exception e) {}
File indexPrimaryRoot = new File(new File(homePath), "DATA/INDEX");
File indexSecondaryRoot = new File(new File(homePath), "DATA/INDEX");
File indexRoot2 = new File(new File(homePath), "DATA/INDEX2");
@@ -1043,7 +1043,7 @@ public final class yacy {
private static void urldbcleanup(String homePath) {
File root = new File(homePath);
File indexroot = new File(root, "DATA/INDEX");
- try {serverLog.configureLogging(new File(homePath, "DATA/LOG/yacy.logging"));} catch (Exception e) {}
+ try {serverLog.configureLogging(homePath,new File(homePath, "DATA/LOG/yacy.logging"));} catch (Exception e) {}
plasmaCrawlLURL currentUrlDB = new plasmaCrawlLURL(indexroot, 10000);
currentUrlDB.urldbcleanup();
currentUrlDB.close();
@@ -1055,7 +1055,7 @@ public final class yacy {
File indexPrimaryRoot = new File(new File(homePath), "DATA/INDEX");
File indexSecondaryRoot = new File(new File(homePath), "DATA/INDEX");
String wordChunkStartHash = "AAAAAAAAAAAA";
- try {serverLog.configureLogging(new File(homePath, "DATA/LOG/yacy.logging"));} catch (Exception e) {}
+ try {serverLog.configureLogging(homePath,new File(homePath, "DATA/LOG/yacy.logging"));} catch (Exception e) {}
log.logInfo("STARTING CREATION OF RWI-HASHLIST");
File root = new File(homePath);
try {