log4j 설정 오류 기록 사용

4676 단어 수필
오늘 새로운 프로젝트 를 Ecilpse 로 가 져 와 서 실 행 했 을 때 오류 가 발생 했 습 니 다.코드 는 다음 과 같 습 니 다:
2018-04-20 10:20:46,896 localhost-startStop-1 ERROR appender Console has no parameter that matches element PatternLayout
2018-04-20 10:21:31,027 localhost-startStop-1 ERROR Unable to invoke factory method in class class org.apache.logging.log4j.flume.appender.FlumeAppender for element Flume. java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:132)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:952)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:892)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:884)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:508)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:232)
	at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:244)
	at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:545)
	at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:617)
	at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:634)
	at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:229)
	at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:152)
	at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
	at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
	at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:122)
	at org.apache.logging.log4j.jcl.LogAdapter.getContext(LogAdapter.java:39)
	at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:46)
	at org.apache.logging.log4j.jcl.LogFactoryImpl.getInstance(LogFactoryImpl.java:40)
	at org.apache.logging.log4j.jcl.LogFactoryImpl.getInstance(LogFactoryImpl.java:55)
	at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:655)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:302)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4745)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoSuchMethodError: org.apache.logging.log4j.core.appender.AbstractManager.(Ljava/lang/String;)V
	at org.apache.logging.log4j.flume.appender.AbstractFlumeManager.(AbstractFlumeManager.java:28)
	at org.apache.logging.log4j.flume.appender.FlumeEmbeddedManager.(FlumeEmbeddedManager.java:57)
	at org.apache.logging.log4j.flume.appender.FlumeEmbeddedManager$FlumeManagerFactory.createManager(FlumeEmbeddedManager.java:174)
	at org.apache.logging.log4j.flume.appender.FlumeEmbeddedManager$FlumeManagerFactory.createManager(FlumeEmbeddedManager.java:157)
	at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:112)
	at org.apache.logging.log4j.flume.appender.FlumeEmbeddedManager.getManager(FlumeEmbeddedManager.java:108)
	at org.apache.logging.log4j.flume.appender.FlumeAppender.createAppender(FlumeAppender.java:243)
	... 35 more

2018-04-20 10:21:31,054 localhost-startStop-1 ERROR Null object returned for Flume in appenders.
2018-04-20 10:21:31,364 localhost-startStop-1 ERROR No appender named FlumeAppender was configured

이 유 는 log4j 설정 오류 입 니 다.실행 가능 한 프로젝트 에서 새로운 log4j 를 복사 하면 됩 니 다.

좋은 웹페이지 즐겨찾기