use of com.ms.silverking.cloud.dht.meta.ClassVarsZK in project SilverKing by Morgan-Stanley.
the class LogStreamConfig method configureLogStreams.
public static void configureLogStreams(SKGridConfiguration gc, String logFileName) throws IOException, KeeperException {
MetaClient dhtMC;
DHTConfiguration dhtConfig;
ClassVarsZK classVarsZK;
ClassVars defaultClassVars;
PrintStream logStream;
File logDir;
dhtMC = new com.ms.silverking.cloud.dht.meta.MetaClient(gc);
dhtConfig = dhtMC.getDHTConfiguration();
classVarsZK = new ClassVarsZK(dhtMC);
if (dhtConfig.getDefaultClassVars() != null) {
defaultClassVars = DHTConstants.defaultDefaultClassVars.overrideWith(classVarsZK.getClassVars(dhtConfig.getDefaultClassVars()));
} else {
defaultClassVars = DHTConstants.defaultDefaultClassVars;
}
logDir = new File(DHTConstants.getSKInstanceLogDir(defaultClassVars, gc));
Log.warning("Ensuring created: ", logDir);
logDir.mkdirs();
logStream = new PrintStream(new BufferedOutputStream(new FileOutputStream(new File(logDir, logFileName))), true);
System.setOut(logStream);
System.setErr(logStream);
Log.setPrintStreams(logStream);
}
Aggregations