I have two applications deployed to the same profile on websphere server, they both need to log information to windows event log using log4j. First, I set up the log4j as a shared library, then reference the shared library from both applications and copy the NTEventLogAppender.dll to the windows\system32. It works well when I use "org.apache.log4j.DailyRollingFileAppender" as appender in the configuration file, I can see the new entry logged in the log file. but after I changed to "org.apache.log4j.nt.NTEventLogAppender", I got the error:
java.lang.UnsatisfiedLinkError: NTEventLogAppender (Library is already loaded in another ClassLoader). By research on interent, I understand this is because the NTEventLogAppender.dll, as a native dll file, is not controlled by websphere server. To avoid this error, it is my responsibility to ensure the dll is only loaded once. There is also an example on the internet to show how to create an utility JAR file and load the native dll file, then set up it as shared library. But with log4j I have no idea how to do this. I have spent lots of time trying to figure out, but still no luck %-|. Could anyone please advise? Any help will be highly appreciated! -- View this message in context: http://www.nabble.com/Log4j---NTEventLogAppender-%28Library-is-already-loaded-in-another-ClassLoader%29-tp22164395p22164395.html Sent from the Log4j - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org