*) passing homepath to serverLog.configureLogging

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3738 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
theli 18 years ago
parent 9a4375b115
commit b30e64daab

@ -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("");

@ -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 {

Loading…
Cancel
Save