this.work = getDir(workDir, "working");
this.conf = getConfigurationFile(this.context, this.configFile);
try {
DefaultContext appContext = new DefaultContext();
appContext.put(
Constants.CONTEXT_CLASS_LOADER,
CocoonWrapper.class.getClassLoader());
cliContext = new CommandLineContext(contextDir);
cliContext.enableLogging(log);
appContext.put(Constants.CONTEXT_ENVIRONMENT_CONTEXT, cliContext);
LogKitLoggerManager logKitLoggerManager =
new LogKitLoggerManager(Hierarchy.getDefaultHierarchy());
logKitLoggerManager.enableLogging(log);
if (this.logKit != null) {
final FileInputStream fis = new FileInputStream(logKit);
final DefaultConfigurationBuilder builder =
new DefaultConfigurationBuilder();
final Configuration logKitConf = builder.build(fis);
final DefaultContext subcontext = new DefaultContext(appContext);
subcontext.put("context-root", contextDir);
logKitLoggerManager.contextualize(subcontext);
logKitLoggerManager.configure(logKitConf);
if (logger != null) {
log = logKitLoggerManager.getLoggerForCategory(logger);
} else {