Skip to content

Commit

Permalink
#40: fix for log4j 2.11.2
Browse files Browse the repository at this point in the history
  • Loading branch information
andrehertwig committed Jun 19, 2019
1 parent 7737ab7 commit 7b247ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 7b247ea

Please sign in to comment.