diff --git a/admin-tools-log4j2/src/main/java/de/chandre/admintool/log4j2/AdminToolLog4j2Util.java b/admin-tools-log4j2/src/main/java/de/chandre/admintool/log4j2/AdminToolLog4j2Util.java index b1459c9..235497e 100644 --- a/admin-tools-log4j2/src/main/java/de/chandre/admintool/log4j2/AdminToolLog4j2Util.java +++ b/admin-tools-log4j2/src/main/java/de/chandre/admintool/log4j2/AdminToolLog4j2Util.java @@ -437,13 +437,7 @@ public String createOutputStreamAppender(String name, String pattern, String enc AdminToolLog4j2OutputStream baos = new AdminToolLog4j2OutputStream(4096, encodingToUse); outputStreams.put(appenderName, baos); - OutputStreamAppender appender = OutputStreamAppender.newBuilder() - .setName(appenderName) - .setTarget(baos) - .setLayout(layout) - .setFollow(false) - .build(); - + OutputStreamAppender appender = OutputStreamAppender.createAppender(layout, null, baos, appenderName, false, true); appender.start(); final LoggerContext ctx = (LoggerContext) LogManager.getContext(false); diff --git a/admin-tools-log4j2/src/main/java/de/chandre/admintool/log4j2/AdminToolLog4jSessionListener.java b/admin-tools-log4j2/src/main/java/de/chandre/admintool/log4j2/AdminToolLog4jSessionListener.java index 28b73c3..5b68f0b 100644 --- a/admin-tools-log4j2/src/main/java/de/chandre/admintool/log4j2/AdminToolLog4jSessionListener.java +++ b/admin-tools-log4j2/src/main/java/de/chandre/admintool/log4j2/AdminToolLog4jSessionListener.java @@ -2,6 +2,7 @@ import java.io.IOException; +import javax.annotation.PostConstruct; import javax.servlet.annotation.WebListener; import javax.servlet.http.HttpSessionEvent; import javax.servlet.http.HttpSessionListener; @@ -32,6 +33,11 @@ public AdminToolLog4jSessionListener() { @Override public void sessionCreated(HttpSessionEvent sessionEvent) {} + + @PostConstruct + private void log() { + LOGGER.info("AdminToolLog4j2Util has been autowired: " + (null != log4jUtil)); + } @Override public void sessionDestroyed(HttpSessionEvent sessionEvent) {