}
// let's configure log4j
final String log4jConfig = getInitParameter("log4j-config", null);
if ( log4jConfig != null ) {
final Log4JConfigurator configurator = new Log4JConfigurator(subcontext);
// test if this is a qualified url
InputStream is = null;
if ( log4jConfig.indexOf(':') == -1) {
is = this.servletContext.getResourceAsStream(log4jConfig);
if (is == null) is = new FileInputStream(log4jConfig);
} else {
final URL log4jURL = new URL(log4jConfig);
is = log4jURL.openStream();
}
configurator.doConfigure(is, LogManager.getLoggerRepository());
}
ContainerUtil.initialize(loggerManager);
} catch (Exception e) {
errorHandler.error("Could not set up Cocoon Logger, will use screen instead", e, null);