Java 第二个模块中的Webservice处理程序阻止log4j2配置

Java 第二个模块中的Webservice处理程序阻止log4j2配置,java,web-services,jax-ws,log4j2,Java,Web Services,Jax Ws,Log4j2,环境: JDK 7,WebLogic 12.1.3.0服务器(补丁3) Maven构建系统 基于Maven,我有一个webservice WAR模块,它依赖于定义webservice处理程序的第二个JAR模块。 Webservice模块有一个上下文侦听器,稍后应该从数据库初始化log4j2(循环)。 任何地方都没有定义log4j2.xml,也没有所需的log4j2.xml 问题在于,当通过在webservice端点使用@HandlerChain注释启用处理程序时,log4j2配置会在web服务上

环境: JDK 7,WebLogic 12.1.3.0服务器(补丁3) Maven构建系统

基于Maven,我有一个webservice WAR模块,它依赖于定义webservice处理程序的第二个JAR模块。 Webservice模块有一个上下文侦听器,稍后应该从数据库初始化log4j2(循环)。 任何地方都没有定义log4j2.xml,也没有所需的log4j2.xml

问题在于,当通过在webservice端点使用@HandlerChain注释启用处理程序时,log4j2配置会在web服务上下文侦听器可以初始化它之前损坏

模块演示Web服务:

@WebService(endpointInterface = "demo.IDemoWebService")
@HandlerChain(file = "handlers.xml")
public class DemoWebService implements IDemoWebService {
...
}

public class DemoServletContextListener implements ServletContextListener {

    /** Status Logger */
    private static final Logger LOG = StatusLogger.getLogger();

    @Override
    public void contextInitialized(ServletContextEvent event) {
        System.out.println("Demo listener context intialized");
        System.out.println(LOG.getLevel() + " - " + LOG.isDebugEnabled() + " - " + LOG.isInfoEnabled() + " - " + LOG.isWarnEnabled());

        LOG.info("LOG Demo listener context intialized");
    }

    @Override
    public void contextDestroyed(ServletContextEvent event) {
        System.out.println("Demo listener context destroyed");
        LOG.info("LOG Demo listener context destroyed");
    }
}
public class WebServiceDemoHandler {

    private static Logger log = LogManager.getLogger(WebServiceDemoHandler.class);

    @Override

    public boolean handleMessage(SOAPMessageContext context) {
        log.info("something");
        return true;
    }

    @Override
    public boolean handlingNotRequired() {
        return false; // this handler always handles the message
    }
}
Demo listener context intialized
TRACE - true - true - true
INFO StatusLogger LOG Demo listener context intialized
DEBUG StatusLogger Loaded Provider Provider[priority=10, className=org.apache.logging.log4j.core.impl.Log4jContextFactory, url=zip:C:wl_homeSer_projectsdomainsbase_domain/tmp/_WL_user/DemoWebService-1.0-SNAPSHOT/3or6mr/war/WEB-INF/lib/log4j-core-2.6.jar!/META-INF/log4j-provider.properties, classLoader=weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f]
DEBUG StatusLogger Loaded Provider Provider[priority=10, className=org.apache.logging.log4j.core.impl.Log4jContextFactory, url=zip:C:wl_homeSer_projectsdomainsbase_domain/tmp/_WL_user/DemoWebService-1.0-SNAPSHOT/3or6mr/war/WEB-INF/lib/log4j-core-2.6.jar!/META-INF/log4j-provider.properties, classLoader=weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war]
DEBUG StatusLogger Using ShutdownCallbackRegistry class org.apache.logging.log4j.core.util.DefaultShutdownCallbackRegistry
DEBUG StatusLogger Using ShutdownCallbackRegistry class org.apache.logging.log4j.core.util.DefaultShutdownCallbackRegistry
DEBUG StatusLogger Took 0,086401 seconds to load 184 plugins from weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f
DEBUG StatusLogger PluginManager 'Converter' found 41 plugins
DEBUG StatusLogger Jansi is not installed, cannot find org.fusesource.jansi.WindowsAnsiOutputStream
DEBUG StatusLogger Starting OutputStreamManager SYSTEM_OUT.false-1
DEBUG StatusLogger Starting LoggerContext[name=7d5bfc18, org.apache.logging.log4j.core.LoggerContext@31da3f72]...
DEBUG StatusLogger Reconfiguration started for context[name=7d5bfc18] at URI null (org.apache.logging.log4j.core.LoggerContext@31da3f72) with optional ClassLoader: null
DEBUG StatusLogger PluginManager 'ConfigurationFactory' found 4 plugins
DEBUG StatusLogger Missing dependencies for Yaml support
DEBUG StatusLogger Missing dependencies for Json support
DEBUG StatusLogger Using configurationFactory org.apache.logging.log4j.core.config.ConfigurationFactory$Factory@83bf63b
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.properties] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.properties] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.properties] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.properties] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.yml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.yml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.yml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.yml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.yaml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.yaml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.yaml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.yaml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.json] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.json] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.json] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.json] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.jsn] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.jsn] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.jsn] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.jsn] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.xml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.xml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.xml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.xml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test.properties] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test.properties] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test.properties] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test.properties] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test.yml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test.yml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test.yml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test.yml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test.yaml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test.yaml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test.yaml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test.yaml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test.json] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test.json] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test.json] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test.json] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test.jsn] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test.jsn] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test.jsn] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test.jsn] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test.xml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test.xml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test.xml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test.xml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j27d5bfc18.properties] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j27d5bfc18.properties] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.properties] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.properties] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j27d5bfc18.yml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j27d5bfc18.yml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.yml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.yml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j27d5bfc18.yaml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j27d5bfc18.yaml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.yaml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.yaml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j27d5bfc18.json] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j27d5bfc18.json] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.json] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.json] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j27d5bfc18.jsn] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j27d5bfc18.jsn] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.jsn] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.jsn] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j27d5bfc18.xml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j27d5bfc18.xml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.xml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.xml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2.properties] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2.properties] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2.properties] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2.properties] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2.yml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2.yml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2.yml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2.yml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2.yaml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2.yaml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2.yaml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2.yaml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2.json] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2.json] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2.json] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2.json] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2.jsn] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2.jsn] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2.jsn] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2.jsn] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2.xml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2.xml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2.xml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2.xml] using ClassLoader.getSystemResource().
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
DEBUG StatusLogger PluginManager 'Converter' found 41 plugins
DEBUG StatusLogger Jansi is not installed, cannot find org.fusesource.jansi.WindowsAnsiOutputStream
DEBUG StatusLogger Starting OutputStreamManager SYSTEM_OUT.false-2
DEBUG StatusLogger Initializing configuration org.apache.logging.log4j.core.config.DefaultConfiguration@6b1cf2b3
DEBUG StatusLogger Installed script engines
DEBUG StatusLogger juel Version: 1.0, Language: JSP 2.1 EL, Threading: MULTITHREADED, Compile: false, Names: {juel}
DEBUG StatusLogger Oracle Nashorn Version: 1.8.0_71, Language: ECMAScript, Threading: Not Thread Safe, Compile: true, Names: {nashorn, Nashorn, js, JS, JavaScript, javascript, ECMAScript, ecmascript}
DEBUG StatusLogger Groovy Scripting Engine Version: 2.0, Language: Groovy, Threading: MULTITHREADED, Compile: true, Names: {groovy, Groovy}
DEBUG StatusLogger PluginManager 'Core' found 100 plugins
DEBUG StatusLogger PluginManager 'Level' found 0 plugins
DEBUG StatusLogger Configuration org.apache.logging.log4j.core.config.DefaultConfiguration@6b1cf2b3 initialized
DEBUG StatusLogger Starting configuration org.apache.logging.log4j.core.config.DefaultConfiguration@6b1cf2b3
DEBUG StatusLogger Started configuration org.apache.logging.log4j.core.config.DefaultConfiguration@6b1cf2b3 OK.
TRACE StatusLogger Stopping org.apache.logging.log4j.core.config.DefaultConfiguration@6f5a0c09...
TRACE StatusLogger DefaultConfiguration notified 1 ReliabilityStrategies that config will be stopped.
TRACE StatusLogger DefaultConfiguration stopping root LoggerConfig.
TRACE StatusLogger DefaultConfiguration notifying ReliabilityStrategies that appenders will be stopped.
TRACE StatusLogger DefaultConfiguration stopping remaining Appenders.
DEBUG StatusLogger Shutting down OutputStreamManager SYSTEM_OUT.false-1
TRACE StatusLogger DefaultConfiguration stopped 1 remaining Appenders.
TRACE StatusLogger DefaultConfiguration cleaning Appenders from 1 LoggerConfigs.
DEBUG StatusLogger Stopped org.apache.logging.log4j.core.config.DefaultConfiguration@6f5a0c09 OK
TRACE StatusLogger Reregistering MBeans after reconfigure. Selector=org.apache.logging.log4j.core.selector.ClassLoaderContextSelector@44387dfb
TRACE StatusLogger Reregistering context (1/1): '7d5bfc18' org.apache.logging.log4j.core.LoggerContext@31da3f72
TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=7d5bfc18'
TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=7d5bfc18,component=StatusLogger'
TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=7d5bfc18,component=ContextSelector'
TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=7d5bfc18,component=Loggers,name=*'
TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=7d5bfc18,component=Appenders,name=*'
TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=7d5bfc18,component=AsyncAppenders,name=*'
TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=7d5bfc18,component=AsyncLoggerRingBuffer'
TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=7d5bfc18,component=Loggers,name=*,subtype=RingBuffer'
DEBUG StatusLogger Registering MBean org.apache.logging.log4j2:type=7d5bfc18
Demo listener context intialized
TRACE - false - false - true
web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">

  <display-name>DemoWebService</display-name>

    <!-- log4j2 configuration -->
    <context-param>
        <param-name>isLog4jAutoInitializationDisabled</param-name>
        <param-value>true</param-value>
    </context-param>

    <listener>
        <listener-class>demo.DemoServletContextListener</listener-class>
    </listener> 

    ...
</web-app>
<?xml version="1.0" encoding="UTF-8"?>
<handler-chains xmlns="http://java.sun.com/xml/ns/javaee">
    <handler-chain>
        <handler>
            <handler-name>Performance</handler-name>
            <handler-class>demo.wshandler.WebServiceDemoHandler</handler-class>
        </handler>
    </handler-chain>
</handler-chains>
现在,当我在@HandlerChain(file=“handlers.xml”)处于活动状态时比较部署期间的服务器日志一次,当注释掉时比较一次,日志中的差异基本上如下几行:

处理程序链未激活:

@WebService(endpointInterface = "demo.IDemoWebService")
@HandlerChain(file = "handlers.xml")
public class DemoWebService implements IDemoWebService {
...
}

public class DemoServletContextListener implements ServletContextListener {

    /** Status Logger */
    private static final Logger LOG = StatusLogger.getLogger();

    @Override
    public void contextInitialized(ServletContextEvent event) {
        System.out.println("Demo listener context intialized");
        System.out.println(LOG.getLevel() + " - " + LOG.isDebugEnabled() + " - " + LOG.isInfoEnabled() + " - " + LOG.isWarnEnabled());

        LOG.info("LOG Demo listener context intialized");
    }

    @Override
    public void contextDestroyed(ServletContextEvent event) {
        System.out.println("Demo listener context destroyed");
        LOG.info("LOG Demo listener context destroyed");
    }
}
public class WebServiceDemoHandler {

    private static Logger log = LogManager.getLogger(WebServiceDemoHandler.class);

    @Override

    public boolean handleMessage(SOAPMessageContext context) {
        log.info("something");
        return true;
    }

    @Override
    public boolean handlingNotRequired() {
        return false; // this handler always handles the message
    }
}
Demo listener context intialized
TRACE - true - true - true
INFO StatusLogger LOG Demo listener context intialized
DEBUG StatusLogger Loaded Provider Provider[priority=10, className=org.apache.logging.log4j.core.impl.Log4jContextFactory, url=zip:C:wl_homeSer_projectsdomainsbase_domain/tmp/_WL_user/DemoWebService-1.0-SNAPSHOT/3or6mr/war/WEB-INF/lib/log4j-core-2.6.jar!/META-INF/log4j-provider.properties, classLoader=weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f]
DEBUG StatusLogger Loaded Provider Provider[priority=10, className=org.apache.logging.log4j.core.impl.Log4jContextFactory, url=zip:C:wl_homeSer_projectsdomainsbase_domain/tmp/_WL_user/DemoWebService-1.0-SNAPSHOT/3or6mr/war/WEB-INF/lib/log4j-core-2.6.jar!/META-INF/log4j-provider.properties, classLoader=weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war]
DEBUG StatusLogger Using ShutdownCallbackRegistry class org.apache.logging.log4j.core.util.DefaultShutdownCallbackRegistry
DEBUG StatusLogger Using ShutdownCallbackRegistry class org.apache.logging.log4j.core.util.DefaultShutdownCallbackRegistry
DEBUG StatusLogger Took 0,086401 seconds to load 184 plugins from weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f
DEBUG StatusLogger PluginManager 'Converter' found 41 plugins
DEBUG StatusLogger Jansi is not installed, cannot find org.fusesource.jansi.WindowsAnsiOutputStream
DEBUG StatusLogger Starting OutputStreamManager SYSTEM_OUT.false-1
DEBUG StatusLogger Starting LoggerContext[name=7d5bfc18, org.apache.logging.log4j.core.LoggerContext@31da3f72]...
DEBUG StatusLogger Reconfiguration started for context[name=7d5bfc18] at URI null (org.apache.logging.log4j.core.LoggerContext@31da3f72) with optional ClassLoader: null
DEBUG StatusLogger PluginManager 'ConfigurationFactory' found 4 plugins
DEBUG StatusLogger Missing dependencies for Yaml support
DEBUG StatusLogger Missing dependencies for Json support
DEBUG StatusLogger Using configurationFactory org.apache.logging.log4j.core.config.ConfigurationFactory$Factory@83bf63b
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.properties] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.properties] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.properties] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.properties] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.yml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.yml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.yml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.yml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.yaml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.yaml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.yaml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.yaml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.json] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.json] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.json] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.json] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.jsn] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.jsn] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.jsn] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.jsn] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.xml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.xml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.xml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.xml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test.properties] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test.properties] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test.properties] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test.properties] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test.yml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test.yml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test.yml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test.yml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test.yaml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test.yaml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test.yaml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test.yaml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test.json] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test.json] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test.json] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test.json] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test.jsn] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test.jsn] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test.jsn] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test.jsn] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test.xml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test.xml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test.xml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test.xml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j27d5bfc18.properties] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j27d5bfc18.properties] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.properties] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.properties] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j27d5bfc18.yml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j27d5bfc18.yml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.yml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.yml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j27d5bfc18.yaml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j27d5bfc18.yaml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.yaml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.yaml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j27d5bfc18.json] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j27d5bfc18.json] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.json] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.json] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j27d5bfc18.jsn] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j27d5bfc18.jsn] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.jsn] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.jsn] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j27d5bfc18.xml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j27d5bfc18.xml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.xml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.xml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2.properties] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2.properties] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2.properties] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2.properties] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2.yml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2.yml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2.yml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2.yml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2.yaml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2.yaml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2.yaml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2.yaml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2.json] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2.json] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2.json] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2.json] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2.jsn] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2.jsn] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2.jsn] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2.jsn] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2.xml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2.xml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2.xml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2.xml] using ClassLoader.getSystemResource().
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
DEBUG StatusLogger PluginManager 'Converter' found 41 plugins
DEBUG StatusLogger Jansi is not installed, cannot find org.fusesource.jansi.WindowsAnsiOutputStream
DEBUG StatusLogger Starting OutputStreamManager SYSTEM_OUT.false-2
DEBUG StatusLogger Initializing configuration org.apache.logging.log4j.core.config.DefaultConfiguration@6b1cf2b3
DEBUG StatusLogger Installed script engines
DEBUG StatusLogger juel Version: 1.0, Language: JSP 2.1 EL, Threading: MULTITHREADED, Compile: false, Names: {juel}
DEBUG StatusLogger Oracle Nashorn Version: 1.8.0_71, Language: ECMAScript, Threading: Not Thread Safe, Compile: true, Names: {nashorn, Nashorn, js, JS, JavaScript, javascript, ECMAScript, ecmascript}
DEBUG StatusLogger Groovy Scripting Engine Version: 2.0, Language: Groovy, Threading: MULTITHREADED, Compile: true, Names: {groovy, Groovy}
DEBUG StatusLogger PluginManager 'Core' found 100 plugins
DEBUG StatusLogger PluginManager 'Level' found 0 plugins
DEBUG StatusLogger Configuration org.apache.logging.log4j.core.config.DefaultConfiguration@6b1cf2b3 initialized
DEBUG StatusLogger Starting configuration org.apache.logging.log4j.core.config.DefaultConfiguration@6b1cf2b3
DEBUG StatusLogger Started configuration org.apache.logging.log4j.core.config.DefaultConfiguration@6b1cf2b3 OK.
TRACE StatusLogger Stopping org.apache.logging.log4j.core.config.DefaultConfiguration@6f5a0c09...
TRACE StatusLogger DefaultConfiguration notified 1 ReliabilityStrategies that config will be stopped.
TRACE StatusLogger DefaultConfiguration stopping root LoggerConfig.
TRACE StatusLogger DefaultConfiguration notifying ReliabilityStrategies that appenders will be stopped.
TRACE StatusLogger DefaultConfiguration stopping remaining Appenders.
DEBUG StatusLogger Shutting down OutputStreamManager SYSTEM_OUT.false-1
TRACE StatusLogger DefaultConfiguration stopped 1 remaining Appenders.
TRACE StatusLogger DefaultConfiguration cleaning Appenders from 1 LoggerConfigs.
DEBUG StatusLogger Stopped org.apache.logging.log4j.core.config.DefaultConfiguration@6f5a0c09 OK
TRACE StatusLogger Reregistering MBeans after reconfigure. Selector=org.apache.logging.log4j.core.selector.ClassLoaderContextSelector@44387dfb
TRACE StatusLogger Reregistering context (1/1): '7d5bfc18' org.apache.logging.log4j.core.LoggerContext@31da3f72
TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=7d5bfc18'
TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=7d5bfc18,component=StatusLogger'
TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=7d5bfc18,component=ContextSelector'
TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=7d5bfc18,component=Loggers,name=*'
TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=7d5bfc18,component=Appenders,name=*'
TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=7d5bfc18,component=AsyncAppenders,name=*'
TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=7d5bfc18,component=AsyncLoggerRingBuffer'
TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=7d5bfc18,component=Loggers,name=*,subtype=RingBuffer'
DEBUG StatusLogger Registering MBean org.apache.logging.log4j2:type=7d5bfc18
Demo listener context intialized
TRACE - false - false - true
处理程序链处于活动状态:

@WebService(endpointInterface = "demo.IDemoWebService")
@HandlerChain(file = "handlers.xml")
public class DemoWebService implements IDemoWebService {
...
}

public class DemoServletContextListener implements ServletContextListener {

    /** Status Logger */
    private static final Logger LOG = StatusLogger.getLogger();

    @Override
    public void contextInitialized(ServletContextEvent event) {
        System.out.println("Demo listener context intialized");
        System.out.println(LOG.getLevel() + " - " + LOG.isDebugEnabled() + " - " + LOG.isInfoEnabled() + " - " + LOG.isWarnEnabled());

        LOG.info("LOG Demo listener context intialized");
    }

    @Override
    public void contextDestroyed(ServletContextEvent event) {
        System.out.println("Demo listener context destroyed");
        LOG.info("LOG Demo listener context destroyed");
    }
}
public class WebServiceDemoHandler {

    private static Logger log = LogManager.getLogger(WebServiceDemoHandler.class);

    @Override

    public boolean handleMessage(SOAPMessageContext context) {
        log.info("something");
        return true;
    }

    @Override
    public boolean handlingNotRequired() {
        return false; // this handler always handles the message
    }
}
Demo listener context intialized
TRACE - true - true - true
INFO StatusLogger LOG Demo listener context intialized
DEBUG StatusLogger Loaded Provider Provider[priority=10, className=org.apache.logging.log4j.core.impl.Log4jContextFactory, url=zip:C:wl_homeSer_projectsdomainsbase_domain/tmp/_WL_user/DemoWebService-1.0-SNAPSHOT/3or6mr/war/WEB-INF/lib/log4j-core-2.6.jar!/META-INF/log4j-provider.properties, classLoader=weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f]
DEBUG StatusLogger Loaded Provider Provider[priority=10, className=org.apache.logging.log4j.core.impl.Log4jContextFactory, url=zip:C:wl_homeSer_projectsdomainsbase_domain/tmp/_WL_user/DemoWebService-1.0-SNAPSHOT/3or6mr/war/WEB-INF/lib/log4j-core-2.6.jar!/META-INF/log4j-provider.properties, classLoader=weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war]
DEBUG StatusLogger Using ShutdownCallbackRegistry class org.apache.logging.log4j.core.util.DefaultShutdownCallbackRegistry
DEBUG StatusLogger Using ShutdownCallbackRegistry class org.apache.logging.log4j.core.util.DefaultShutdownCallbackRegistry
DEBUG StatusLogger Took 0,086401 seconds to load 184 plugins from weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f
DEBUG StatusLogger PluginManager 'Converter' found 41 plugins
DEBUG StatusLogger Jansi is not installed, cannot find org.fusesource.jansi.WindowsAnsiOutputStream
DEBUG StatusLogger Starting OutputStreamManager SYSTEM_OUT.false-1
DEBUG StatusLogger Starting LoggerContext[name=7d5bfc18, org.apache.logging.log4j.core.LoggerContext@31da3f72]...
DEBUG StatusLogger Reconfiguration started for context[name=7d5bfc18] at URI null (org.apache.logging.log4j.core.LoggerContext@31da3f72) with optional ClassLoader: null
DEBUG StatusLogger PluginManager 'ConfigurationFactory' found 4 plugins
DEBUG StatusLogger Missing dependencies for Yaml support
DEBUG StatusLogger Missing dependencies for Json support
DEBUG StatusLogger Using configurationFactory org.apache.logging.log4j.core.config.ConfigurationFactory$Factory@83bf63b
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.properties] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.properties] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.properties] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.properties] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.yml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.yml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.yml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.yml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.yaml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.yaml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.yaml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.yaml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.json] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.json] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.json] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.json] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.jsn] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.jsn] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.jsn] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.jsn] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.xml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.xml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.xml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test7d5bfc18.xml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test.properties] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test.properties] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test.properties] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test.properties] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test.yml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test.yml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test.yml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test.yml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test.yaml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test.yaml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test.yaml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test.yaml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test.json] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test.json] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test.json] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test.json] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test.jsn] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test.jsn] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test.jsn] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test.jsn] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2-test.xml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2-test.xml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2-test.xml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2-test.xml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j27d5bfc18.properties] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j27d5bfc18.properties] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.properties] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.properties] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j27d5bfc18.yml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j27d5bfc18.yml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.yml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.yml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j27d5bfc18.yaml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j27d5bfc18.yaml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.yaml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.yaml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j27d5bfc18.json] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j27d5bfc18.json] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.json] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.json] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j27d5bfc18.jsn] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j27d5bfc18.jsn] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.jsn] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.jsn] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j27d5bfc18.xml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j27d5bfc18.xml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.xml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j27d5bfc18.xml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2.properties] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2.properties] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2.properties] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2.properties] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2.yml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2.yml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2.yml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2.yml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2.yaml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2.yaml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2.yaml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2.yaml] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2.json] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2.json] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2.json] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2.json] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2.jsn] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2.jsn] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2.jsn] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2.jsn] using ClassLoader.getSystemResource().
TRACE StatusLogger Trying to find [log4j2.xml] using context class loader weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f.
TRACE StatusLogger Trying to find [log4j2.xml] using weblogic.utils.classloaders.ChangeAwareClassLoader@7d5bfc18 finder: weblogic.utils.classloaders.CodeGenClassFinder@5a13f911 annotation: DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war class loader.
TRACE StatusLogger Trying to find [log4j2.xml] using weblogic.wsee.util.ClassLoaderUtil$DelegatingLoader@2883f04f class loader.
TRACE StatusLogger Trying to find [log4j2.xml] using ClassLoader.getSystemResource().
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
DEBUG StatusLogger PluginManager 'Converter' found 41 plugins
DEBUG StatusLogger Jansi is not installed, cannot find org.fusesource.jansi.WindowsAnsiOutputStream
DEBUG StatusLogger Starting OutputStreamManager SYSTEM_OUT.false-2
DEBUG StatusLogger Initializing configuration org.apache.logging.log4j.core.config.DefaultConfiguration@6b1cf2b3
DEBUG StatusLogger Installed script engines
DEBUG StatusLogger juel Version: 1.0, Language: JSP 2.1 EL, Threading: MULTITHREADED, Compile: false, Names: {juel}
DEBUG StatusLogger Oracle Nashorn Version: 1.8.0_71, Language: ECMAScript, Threading: Not Thread Safe, Compile: true, Names: {nashorn, Nashorn, js, JS, JavaScript, javascript, ECMAScript, ecmascript}
DEBUG StatusLogger Groovy Scripting Engine Version: 2.0, Language: Groovy, Threading: MULTITHREADED, Compile: true, Names: {groovy, Groovy}
DEBUG StatusLogger PluginManager 'Core' found 100 plugins
DEBUG StatusLogger PluginManager 'Level' found 0 plugins
DEBUG StatusLogger Configuration org.apache.logging.log4j.core.config.DefaultConfiguration@6b1cf2b3 initialized
DEBUG StatusLogger Starting configuration org.apache.logging.log4j.core.config.DefaultConfiguration@6b1cf2b3
DEBUG StatusLogger Started configuration org.apache.logging.log4j.core.config.DefaultConfiguration@6b1cf2b3 OK.
TRACE StatusLogger Stopping org.apache.logging.log4j.core.config.DefaultConfiguration@6f5a0c09...
TRACE StatusLogger DefaultConfiguration notified 1 ReliabilityStrategies that config will be stopped.
TRACE StatusLogger DefaultConfiguration stopping root LoggerConfig.
TRACE StatusLogger DefaultConfiguration notifying ReliabilityStrategies that appenders will be stopped.
TRACE StatusLogger DefaultConfiguration stopping remaining Appenders.
DEBUG StatusLogger Shutting down OutputStreamManager SYSTEM_OUT.false-1
TRACE StatusLogger DefaultConfiguration stopped 1 remaining Appenders.
TRACE StatusLogger DefaultConfiguration cleaning Appenders from 1 LoggerConfigs.
DEBUG StatusLogger Stopped org.apache.logging.log4j.core.config.DefaultConfiguration@6f5a0c09 OK
TRACE StatusLogger Reregistering MBeans after reconfigure. Selector=org.apache.logging.log4j.core.selector.ClassLoaderContextSelector@44387dfb
TRACE StatusLogger Reregistering context (1/1): '7d5bfc18' org.apache.logging.log4j.core.LoggerContext@31da3f72
TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=7d5bfc18'
TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=7d5bfc18,component=StatusLogger'
TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=7d5bfc18,component=ContextSelector'
TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=7d5bfc18,component=Loggers,name=*'
TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=7d5bfc18,component=Appenders,name=*'
TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=7d5bfc18,component=AsyncAppenders,name=*'
TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=7d5bfc18,component=AsyncLoggerRingBuffer'
TRACE StatusLogger Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=7d5bfc18,component=Loggers,name=*,subtype=RingBuffer'
DEBUG StatusLogger Registering MBean org.apache.logging.log4j2:type=7d5bfc18
Demo listener context intialized
TRACE - false - false - true

这里发生的是,我猜Java的类加载器在web上下文侦听器之前变为活动状态,然后触发log4j2的初始化,这是不需要的。这将导致无法恢复的损坏log4j2配置,并且所有后续日志都将丢失。

您是否尝试在
DemoServletContextListener中将日志状态记录器字段声明为非静态?
加载该类将导致Log4j2自身初始化

如果要将Log4j2初始化推迟到加载
webservicedemodhandler
,则可能根本不应该在
DemoServletContextListener
中使用状态记录器

另外,查看状态记录器输出的前两行,有两个类加载器和第一个(
weblogic.wsee.util.ClassLoaderUtil)$DelegatingLoader@2883f04f
)开始初始化Log4j2


还有一个
weblogic.utils.classloaders。ChangeAwareClassLoader@7d5bfc18查找程序:weblogic.utils.classloaders。CodeGenClassFinder@5a13f911注释:DemoWebService-1.0-SNAPSHOT@DemoWebService-1.0-SNAPSHOT.war
classloader,显然不起作用。根据名称,第二个类加载器用于web应用程序。我想您希望Log4j2由这个第二类加载器初始化。不确定第一个类加载器来自何处,但这可能是进一步调查的好线索

发布问题的答案很简单,可以包含在类中DemoServletContextListener行中

StatusLogger.getLogger().reset();
状态记录器将再次工作。
但是,无法像这样解决损坏的整体logj4配置。然而,这里省略了初始化代码,因此充其量只是另一篇博文的主题——

Hi Remko!非常感谢你的回答。是的,我试过了,并在WebServiceDemoHandler中将记录器定义为非静态的。这没有帮助。唯一有用的是在第二个模块wshandler中根本不使用log4j2。通过添加以下行StatusLogger.getLogger().reset(),我可以让StatusLogger在DemoServletContextListener中再次工作;但无法保存应在上下文侦听器中进行的总体日志配置。(为了简洁起见,省略了在上下文侦听器中记录初始化的代码。)Sue,值得表扬。刚才,我自己也缺少它们,做任何事情干杯或者如果您不在处理程序本身中使用log4j,那么可能太早了