private void initLog() throws IOException {
// LATER: make dedicated appender format for session log.
Appender app = slog.getAppender("SESSION_LOG");
- slog.addAppender(new FileAppender(app.getLayout(), new File(sessionDir, SESSION_LOG).getAbsolutePath()));
+ // slog.addAppender(new FileAppender(app.getLayout(), new File(sessionDir, SESSION_LOG).getAbsolutePath()));
+
+ //Appender app = slog.getAppender("SESSION_LOG");
+ if (app == null) log.info("No appender for SESSION_LOG");
+
+ if (slog!= null && app != null)
+ {
+ if (app instanceof FileAppender)
+ {
+ File sessionLogFile = new File(this.sessionDir, ((FileAppender)app).getFile());
+ slog.addAppender(new FileAppender(app.getLayout(), sessionLogFile.getAbsolutePath()));
+ }
+ // slog.removeAppender("SESSION_LOG");
+ }
}
/**
if (!sessionDir.isDirectory() || !sessionDir.canWrite() || !sessionDir.canRead())
throw new IOException("Cannot access '"+sessionDir+"' as a read/writable Directory.");
if (checkSessionFiles(sessionDir)) {
+ createSessionFiles();
+ }
// session files exist in the directory
this.sessionDir = sessionDir;
initSessionObjects();
slog.debug("Initialising additional VamsasSession instance");
log.debug("Attached to VamsasSession in "+sessionDir);
- }
+ //}
} else {
// start from scratch
if (!sessionDir.mkdir())