servletContext.setInitParameter("Name2", "Jerry");
servletContext.setInitParameter("log4jConfiguration", "log4j-webvar.xml");
Log4jWebLifeCycle initializer = Log4jWebInitializerImpl.getLog4jWebInitializer(servletContext);
initializer.start();
initializer.setLoggerContext();
LoggerContext ctx = ContextAnchor.THREAD_CONTEXT.get();
assertNotNull("No LoggerContext", ctx);
assertNotNull("No ServletContext", ctx.getExternalContext());
Configuration config = ctx.getConfiguration();
assertNotNull("No Configuration", config);
Map<String, Appender> appenders = config.getAppenders();
for (Map.Entry<String, Appender> entry : appenders.entrySet()) {
if (entry.getKey().equals("file")) {
FileAppender fa = (FileAppender) entry.getValue();