[ https://issues.apache.org/jira/browse/LOG4J2-706?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Remko Popma reassigned LOG4J2-706: ---------------------------------- Assignee: Remko Popma > InvocationTargetException with RollingFileAppender in Log4J2 > ------------------------------------------------------------ > > Key: LOG4J2-706 > URL: https://issues.apache.org/jira/browse/LOG4J2-706 > Project: Log4j 2 > Issue Type: Question > Components: Appenders > Affects Versions: 2.0-rc2 > Reporter: David Roberts > Assignee: Remko Popma > Priority: Minor > > I'm trying to use a RollingFileAppender in Log4J2 and apparently I'm missing > something. The file is created with 0 bytes, but no logging goes to it. > When I turn on the trace I see the following error message logged (to the > console) by log4J2: > {code} > 2014-07-08 19:51:11,354 DEBUG Starting RollingFileManager c:/logs/blah.log > 2014-07-08 19:51:11,464 DEBUG Generated plugins in 0.108079890 seconds > 2014-07-08 19:51:11,465 ERROR Unable to invoke method createAppender in > class org.apache.logging.log4j.core.appender.RollingFileAppender for element > RollingFile java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at > org.apache.logging.log4j.core.config.BaseConfiguration.createPluginObject(BaseConfiguration.java:913) > {code} > This is my config file: > {code} > <?xml version="1.0" encoding="UTF-8"?> > <configuration status="TRACE" verbose="false"> > <appenders> > <Console name="Console" target="SYSTEM_OUT"> > <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} > - %msg%n"/> > </Console> > <RollingFile name="Blah" fileName="c:/logs/blah.log" > filePattern="c:/logs/blah-%i.log"> > <PatternLayout pattern="%d %p %c: %m%n"/> > <Policies> > <TimeBasedTriggeringPolicy /> > <SizeBasedTriggeringPolicy size="1 MB"/> > </Policies> > <DefaultRolloverStrategy max="10"/> > </RollingFile> > </appenders> > <loggers> > <root level="INFO"> > <appender-ref ref="Blah" level="INFO"/> > </root> > </loggers> > </configuration> > {code} > It's probably something basic but I can't find it. I posted on stackoverflow > and Remko Popma asked me to post a ticket here. > I was getting the problem on rc1, but I have now updated to rc2 and I still > see the same issue. -- This message was sent by Atlassian JIRA (v6.2#6252) --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org