logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-706) InvocationTargetException with RollingFileAppender in Log4J2
Date Wed, 09 Jul 2014 17:59:05 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14056530#comment-14056530
] 

Gary Gregory commented on LOG4J2-706:
-------------------------------------

I created and fixed [LOG4J2-707] which should help in diagnosing these kinds of issues.

To get this extra information, you'll need to checkout and build trunk locally with Maven
with "mvn clean install" and then make your project depend on 2.0-SNAPSHOT instead of 2.0-rc2.

> 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
>            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:
>     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)
> This is my config file:
>     <?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>
> 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-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message