一旦服务器启动,我就会收到这个错误,错误显示log4j2。找不到xml,
[11/17/16 11:36:04:007 GMT+00:00] 0000008e SystemErr R ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
下面是log4j2。已配置的xml。
<Configuration status="trace" name="ICM_App" packages="scb.framework.logger.service.util"
monitorInterval="1800">
<Appenders>
<Routing name="common_ref">
<Routes pattern="$${file:fileName}">
<Route>
<RollingFile name="Rolling-${file:fileName}"
fileName="${file:fileName}.log" filePattern="${file:fileName}-%i.log.gz">
<PatternLayout>
<pattern>[%d{dd/MM/yyyy#HH:mm:ss:S}] %m%n</pattern>
</PatternLayout>
<DefaultRolloverStrategy max="5" fileIndex="max" min="1" compressionLevel="5"/>
<Policies>
<SizeBasedTriggeringPolicy size="1 MB" />
</Policies>
</RollingFile>
</Route>
</Routes>
</Routing>
<Routing name="Integration_ref">
<Routes pattern="$${file:fileName}">
<Route>
<RollingFile name="Rolling-${file:fileName}"
fileName="${file:fileName}.log" filePattern="${file:fileName}-%i.log.gz">
<PatternLayout>
<pattern>[%d{dd/MM/yyyy#HH:mm:ss:S}] %m%n</pattern>
</PatternLayout>
<DefaultRolloverStrategy max="5" fileIndex="max" min="1" compressionLevel="5"/>
<Policies>
<SizeBasedTriggeringPolicy size="1 MB" />
</Policies>
</RollingFile>
</Route>
</Routes>
</Routing>
<Console name="STDOUT">
<PatternLayout pattern="[%d{dd/MM/yyyy#HH:mm:ss:S}] %m%n" />
</Console>
</Appenders>
<!-- Define the Loggers including Root, Inside program this name will be called -->
<Loggers>
<!-- Root Logger to write log into console, in the worst case scenario if some think went wrong -->
<Root level="error">
<AppenderRef ref="common_ref"/>
</Root>
<!-- Default Logger Setup - Log will be written based on the input request, file name will be determined by system -->
<AsyncLogger name="common" level="ALL" additivity="FALSE" includeLocation="true" >
<AppenderRef ref="common_ref" />
</AsyncLogger>
<!-- User Specific log setup, like request.log, listner.log etc -->
<AsyncLogger name="Integration" level="ALL" additivity="FALSE" includeLocation="true" >
<AppenderRef ref="Integration_ref" />
</AsyncLogger>
</Loggers>
</Configuration>
因此,我将log4j2中的级别更改为trace。并在控制台中获取以下日志。
[11/17/16 11:36:08:885 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:08,884 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Initializing configuration XmlConfiguration[location=/apps/config/log4j2.xml]
[11/17/16 11:36:08:886 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:08,886 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Installed script engines
[11/17/16 11:36:08:976 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:08,976 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Mozilla Rhino Version: 1.7 release 3 PRERELEASE, Language: ECMAScript, Threading: MULTITHREADED, Compile: true, Names: {js, rhino, JavaScript, javascript, ECMAScript, ecmascript}
[11/17/16 11:36:08:980 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:08,979 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Took 0.001964 seconds to load 0 plugins from package scb.framework.logger.service.util
[11/17/16 11:36:08:980 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:08,980 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG PluginManager 'Core' found 97 plugins
[11/17/16 11:36:08:981 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:08,981 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG PluginManager 'Level' found 0 plugins
[11/17/16 11:36:08:988 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:08,987 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Starting 1 Log4j2Scheduled threads
[11/17/16 11:36:08:990 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:08,989 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG PluginManager 'Lookup' found 14 plugins
[11/17/16 11:36:08:994 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:08,993 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Building Plugin[name=Route, class=org.apache.logging.log4j.core.appender.routing.Route].
[11/17/16 11:36:09:014 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,014 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 TRACE TypeConverterRegistry initializing.
[11/17/16 11:36:09:015 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,015 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG PluginManager 'TypeConverter' found 23 plugins
[11/17/16 11:36:09:028 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,028 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG createRoute(ref="null", key="null", Node=Route)
[11/17/16 11:36:09:029 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,029 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Building Plugin[name=Routes, class=org.apache.logging.log4j.core.appender.routing.Routes].
[11/17/16 11:36:09:035 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,035 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG createRoutes(pattern="${file:fileName}", ={Route(type=dynamic - type=Route default)})
[11/17/16 11:36:09:036 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,036 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Building Plugin[name=appender, class=org.apache.logging.log4j.core.appender.routing.RoutingAppender].
[11/17/16 11:36:09:042 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,041 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG createAppender(name="common_ref", ignoreExceptions="null", Routes({Route(type=dynamic - type=Route default)}), Configuration(ICM_App), RewritePolicy=null, PurgePolicy=null, Filter=null)
[11/17/16 11:36:09:043 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,043 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Building Plugin[name=Route, class=org.apache.logging.log4j.core.appender.routing.Route].
[11/17/16 11:36:09:045 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,044 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG createRoute(ref="null", key="null", Node=Route)
[11/17/16 11:36:09:045 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,045 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Building Plugin[name=Routes, class=org.apache.logging.log4j.core.appender.routing.Routes].
[11/17/16 11:36:09:046 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,046 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG createRoutes(pattern="${file:fileName}", ={Route(type=dynamic - type=Route default)})
[11/17/16 11:36:09:047 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,047 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Building Plugin[name=appender, class=org.apache.logging.log4j.core.appender.routing.RoutingAppender].
[11/17/16 11:36:09:049 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,048 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG createAppender(name="Integration_ref", ignoreExceptions="null", Routes({Route(type=dynamic - type=Route default)}), Configuration(ICM_App), RewritePolicy=null, PurgePolicy=null, Filter=null)
[11/17/16 11:36:09:050 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,049 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Building Plugin[name=layout, class=org.apache.logging.log4j.core.layout.PatternLayout].
[11/17/16 11:36:09:058 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,058 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG PatternLayout$Builder(pattern="[%d{dd/MM/yyyy#HH:mm:ss:S}] %m%n", PatternSelector=null, Configuration(ICM_App), Replace=null, charset="null", alwaysWriteExceptions="null", noConsoleNoAnsi="null", header="null", footer="null")
[11/17/16 11:36:09:060 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,059 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG PluginManager 'Converter' found 38 plugins
[11/17/16 11:36:09:095 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,094 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Building Plugin[name=appender, class=org.apache.logging.log4j.core.appender.ConsoleAppender].
[11/17/16 11:36:09:100 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,100 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 INFO Log4j appears to be running in a Servlet environment, but there's no log4j-web module available. If you want better web container support, please add the log4j-web JAR to your web archive or server lib directory.
[11/17/16 11:36:09:101 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,101 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG PluginManager 'Converter' found 38 plugins
[11/17/16 11:36:09:103 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,102 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Starting OutputStreamManager SYSTEM_OUT.false-4
[11/17/16 11:36:09:112 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,111 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG ConsoleAppender$Builder(PatternLayout([%d{dd/MM/yyyy#HH:mm:ss:S}] %m%n), Filter=null, target="null", name="STDOUT", follow="null", ignoreExceptions="null")
[11/17/16 11:36:09:113 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,112 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Starting OutputStreamManager SYSTEM_OUT.false
[11/17/16 11:36:09:113 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,113 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Building Plugin[name=appenders, class=org.apache.logging.log4j.core.config.AppendersPlugin].
[11/17/16 11:36:09:115 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,115 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG createAppenders(={common_ref, Integration_ref, STDOUT})
[11/17/16 11:36:09:116 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,116 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Building Plugin[name=AppenderRef, class=org.apache.logging.log4j.core.config.AppenderRef].
[11/17/16 11:36:09:117 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,117 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG createAppenderRef(ref="common_ref", level="null", Filter=null)
[11/17/16 11:36:09:118 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,118 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Building Plugin[name=root, class=org.apache.logging.log4j.core.config.LoggerConfig$RootLogger].
[11/17/16 11:36:09:120 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,120 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG createLogger(additivity="null", level="ERROR", includeLocation="null", ={common_ref}, ={}, Configuration(ICM_App), Filter=null)
[11/17/16 11:36:09:125 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,125 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Building Plugin[name=AppenderRef, class=org.apache.logging.log4j.core.config.AppenderRef].
[11/17/16 11:36:09:126 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,126 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG createAppenderRef(ref="common_ref", level="null", Filter=null)
[11/17/16 11:36:09:127 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,127 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Building Plugin[name=asyncLogger, class=org.apache.logging.log4j.core.async.AsyncLoggerConfig].
[11/17/16 11:36:09:130 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,130 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG createLogger(additivity="FALSE", level="ALL", name="common", includeLocation="true", ={common_ref}, ={}, Configuration(ICM_App), Filter=null)
[11/17/16 11:36:09:138 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,138 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Building Plugin[name=AppenderRef, class=org.apache.logging.log4j.core.config.AppenderRef].
[11/17/16 11:36:09:139 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,139 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG createAppenderRef(ref="Integration_ref", level="null", Filter=null)
[11/17/16 11:36:09:140 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,140 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Building Plugin[name=asyncLogger, class=org.apache.logging.log4j.core.async.AsyncLoggerConfig].
[11/17/16 11:36:09:142 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,141 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG createLogger(additivity="FALSE", level="ALL", name="Integration", includeLocation="true", ={Integration_ref}, ={}, Configuration(ICM_App), Filter=null)
[11/17/16 11:36:09:142 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,142 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Building Plugin[name=loggers, class=org.apache.logging.log4j.core.config.LoggersPlugin].
[11/17/16 11:36:09:144 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,144 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG createLoggers(={root, common, Integration})
[11/17/16 11:36:09:145 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,145 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Configuration XmlConfiguration[location=/apps/config/log4j2.xml] initialized
[11/17/16 11:36:09:146 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,146 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Starting configuration XmlConfiguration[location=/apps/config/log4j2.xml]
[11/17/16 11:36:09:149 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,149 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 TRACE AsyncLoggerConfigHelper creating new disruptor for this configuration.
[11/17/16 11:36:09:279 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,279 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Starting AsyncLoggerConfig disruptor for this configuration with ringbufferSize=262144, waitStrategy=BlockingWaitStrategy, exceptionHandler=null...
[11/17/16 11:36:09:282 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,282 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 TRACE AsyncLoggerConfig[common] starting...
[11/17/16 11:36:09:283 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,283 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 TRACE AsyncLoggerConfig[Integration] starting...
[11/17/16 11:36:09:284 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,284 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Started configuration XmlConfiguration[location=/apps/config/log4j2.xml] OK.
[11/17/16 11:36:09:285 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,284 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 TRACE Stopping org.apache.logging.log4j.core.config.DefaultConfiguration@3c3d5fdd...
[11/17/16 11:36:09:285 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,285 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 TRACE DefaultConfiguration notified 1 ReliabilityStrategies that config will be stopped.
[11/17/16 11:36:09:286 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,286 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 TRACE DefaultConfiguration stopping root LoggerConfig.
[11/17/16 11:36:09:287 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,287 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 TRACE DefaultConfiguration notifying ReliabilityStrategies that appenders will be stopped.
[11/17/16 11:36:09:288 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,287 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 TRACE DefaultConfiguration stopping remaining Appenders.
[11/17/16 11:36:09:288 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,288 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Shutting down OutputStreamManager SYSTEM_OUT.false-3
[11/17/16 11:36:09:289 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,289 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 TRACE DefaultConfiguration stopped 1 remaining Appenders.
[11/17/16 11:36:09:290 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,290 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 TRACE DefaultConfiguration cleaning Appenders from 1 LoggerConfigs.
[11/17/16 11:36:09:291 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,290 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Stopped org.apache.logging.log4j.core.config.DefaultConfiguration@3c3d5fdd OK
[11/17/16 11:36:09:291 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,291 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 TRACE Reregistering MBeans after reconfigure. Selector=org.apache.logging.log4j.core.selector.ClassLoaderContextSelector@4bc79692
[11/17/16 11:36:09:292 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,292 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 TRACE Reregistering context (1/1): 'c0ae655e' org.apache.logging.log4j.core.LoggerContext@6b032e73
[11/17/16 11:36:09:293 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,293 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 TRACE Unregistering 1 MBeans: [org.apache.logging.log4j2:type=c0ae655e]
[11/17/16 11:36:09:294 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,294 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 TRACE Unregistering 1 MBeans: [org.apache.logging.log4j2:type=c0ae655e,component=StatusLogger]
[11/17/16 11:36:09:295 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,295 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 TRACE Unregistering 1 MBeans: [org.apache.logging.log4j2:type=c0ae655e,component=ContextSelector]
[11/17/16 11:36:09:296 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,296 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 TRACE Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=c0ae655e,component=Loggers,name=*'
[11/17/16 11:36:09:297 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,297 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 TRACE Unregistering 1 MBeans: [org.apache.logging.log4j2:type=c0ae655e,component=Appenders,name=DefaultConsole-2]
[11/17/16 11:36:09:298 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,298 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 TRACE Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=c0ae655e,component=AsyncAppenders,name=*'
[11/17/16 11:36:09:299 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,299 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 TRACE Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=c0ae655e,component=AsyncLoggerRingBuffer'
[11/17/16 11:36:09:300 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,300 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 TRACE Unregistering but no MBeans found matching 'org.apache.logging.log4j2:type=c0ae655e,component=Loggers,name=*,subtype=RingBuffer'
[11/17/16 11:36:09:301 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,301 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Registering MBean org.apache.logging.log4j2:type=c0ae655e
[11/17/16 11:36:09:302 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,302 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Registering MBean org.apache.logging.log4j2:type=c0ae655e,component=StatusLogger
[11/17/16 11:36:09:303 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,303 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Registering MBean org.apache.logging.log4j2:type=c0ae655e,component=ContextSelector
[11/17/16 11:36:09:304 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,304 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Registering MBean org.apache.logging.log4j2:type=c0ae655e,component=Appenders,name=DefaultConsole-2
[11/17/16 11:36:09:305 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,305 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 TRACE Using DummyNanoClock for nanosecond timestamps.
[11/17/16 11:36:09:306 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,305 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Reconfiguration complete for context[name=Default] at URI /apps/config/log4j2.xml (org.apache.logging.log4j.core.LoggerContext@ed745992) with optional ClassLoader: null
[11/17/16 11:36:09:306 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,306 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG Shutdown hook enabled. Registering a new one.
[11/17/16 11:36:09:307 GMT+00:00] 0000008e SystemOut O 2016-11-17 14:36:09,307 WebSphere_EJB_Timer_Service_WorkManager.Alarm Pool : 0 DEBUG LoggerContext[name=Default, org.apache.logging.log4j.core.LoggerContext@ed745992] started OK
我们的是一个具有多个EJB和WAR文件的EJB应用程序。log4j2。xml驻留在自定义配置路径中,通过在代码中设置以下属性来读取它
System.set属性("log4j.configuration文件","/apps/config/log4j2.xml")
EJB和WEB App都会引发相同的错误。以下是共享库路径中可用的罐,顺序如下...
log4j-api-2.5.jar
log4j-core-2.5.jar
log4j-2.0.jar
slf4j-log4j12-1.6.1.jar
如果有人能提示为什么初始化后返回默认配置,我们将不胜感激,因为我们的项目刚刚开始实现log4j2。。所以任何线索都会有帮助。。。非常感谢。
使现代化
做了被推荐的更改,然后它仍然不起作用。我们的应用程序使用hibernate 4.2.7,因此下面的jar可以在库中使用-jboss-loging-3.2.0。Final.jar.一旦我删除它,日志记录器工作正常。但是当我们调用DAO使用Hibernate会话时,我们会得到这个
Caused by: java.lang.ClassNotFoundException: org.jboss.logging.BasicLogger
at java.net.URLClassLoader.findClass(URLClassLoader.java:600)
at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:243
因此,尝试为log4j2找出jboss日志jar的正确版本。5.
最终更新
添加了jboss-logging-3.1。0.GA。jar和slf4j-api-1.7。2.jar连接到共享库,它运行良好。
为Web或EJB应用程序配置日志记录时,很大程度上取决于应用程序的结构,log4j2罐的位置和配置文件的位置。编辑:谢谢你更新你的问题与一些更多的细节。
我在您发布的Log4j状态消息中看到此通知,您可能希望将Log4j web jar添加到您的依赖项中:
INFO Log4j似乎运行在Servlet环境中,但没有可用的log4j-web模块。如果您想要更好的Web容器支持,请将log4j-web JAR添加到您的Web存档或服务器库目录中。
看看依赖关系,我假设您使用的是Java 6,这就是为什么您使用的是较旧版本的Log4j2。(如果没有,请升级到最新版本,目前为2.7)。
请移开
log4j-2.0.jar //what's this?
slf4j-log4j12-1.6.1.jar // Log4j 1.2
相反,添加
log4j-web-2.5.jar
log4j-slf4j-impl-2.5.jar
我看到您有一个自定义的文件:
查找,它用作路由密钥和文件名。如果不使用自定义查找,是否也会出现问题?
问题内容: 我有这个代码: 这会导致编译错误:可能尚未初始化,这很公平。 现在,我将代码更改为: 我得到同样的编译错误!我必须初始化为null: 那么,不初始化对象和初始化为null有什么区别?如果我声明一个没有初始化的对象,它是否为null? 谢谢 问题答案: 字段(成员变量)被初始化为(或初始化为默认的原始值,如果它们是原始的) 局部变量未初始化,您有责任设置初始值。
问题内容: 这是无效的代码: 这是一个愚蠢的示例,但是在静态类构造函数中,我们不能这样做。为什么?是否有充分的理由呢?有人对此有更多了解吗? 因此,我应该这样做的原因是在那里结束构建。 谢谢 问题答案: 我认为原因是初始化程序与字段初始化(以及实例初始化程序的构造函数)一起携带。换句话说,JVM仅识别一个位置来初始化静态字段,因此所有的初始化(无论是否以块为单位)都必须在此完成。 因此,例如,当您
问题内容: 考虑一下这个功能: 有人可以解释一下为什么L1和L2显然无法到达时没有给出警告,而L3却给出了警告。 问题答案: 因为就编译器而言,这只是另一个方法调用。 它所做的是结束过程这一事实只能从实现中找到(这是本机代码,而没有任何区别)。 如果你必须把你的代码(通常也最好避免它,除非你想返回0以外的代码),它应该是一个方法,返回,例如。这样更好。 关于可达性,解释是相同的:是Java语言的关
问题内容: 我有2节课: Class A: Class B: I create a Main class which just creates new A: The output I get is: 如您所见,A的构造函数在其静态初始值设定项之前被调用。 我了解它与我创建的循环依赖关系有关,但我印象中静态初始化程序应始终在构造函数之前运行。 发生这种情况的原因是什么(技术上在Java实现中)? 是
本文向大家介绍C++11特性小结之decltype、类内初始化、列表初始化返回值,包括了C++11特性小结之decltype、类内初始化、列表初始化返回值的使用技巧和注意事项,需要的朋友参考一下 作用:返回表达式或变量的类型 返回值规则: 若e是一个左值(lvalue,即“可寻址值”),则decltype(e)将返回T& 若e是一个临终值(xvalue),则返回值为T&& 若e是一个纯右值(prv
所以我想用java编写一个Tic-Tac-Toe游戏。 现在点击一个按钮,我想把按钮的图像设置为“十字”或“圆圈”,但是一旦一个类型跟随代码,按钮就会消失,直到我悬停在它们上面,然后它们就会返回。 没有上面的代码会是什么样子 这里的项目结构