Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use LoggingEvent class with log4j 2.2

I want to migrate from Log4j 1.x to Log4j 2.x. So I'm trying to use log4j-1.2-api.jar as mentioned here. My application has an implementation of org.apache.log4j.spi.LoggingEvent, but I cannot find a way to use LoggingEvent with the log4j 2.x api bridge. Is there anyway that I can use LoggingEvent with log4j 2.2 ?

Thanks.

like image 795
Grant Avatar asked Apr 09 '15 14:04

Grant


1 Answers

When upgrading Log4j, I simply used LogEvent instead of LoggingEvent.

I had removed AppenderSkeleton and replaced it with AbstractAppender. AppenderSkeleton's append(LoggingEvent event) method appears in AbstractAppender as append(LogEvent event), which was my cue to use LogEvent instead of LoggingEvent.

like image 173
mherzl Avatar answered Sep 17 '22 00:09

mherzl