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

Ralph Goers commented on LOG4J2-97:
-----------------------------------

The workaround for the above problem consists of choosing from one of the 
following 3 options:

1. 
http://velocity.apache.org/engine/releases/velocity-1.7/developer-guide.html#usinglog4jwithexistinglogger
 documents how to use an existing Log4j Logger. If this is done Velocity won't 
create an Appender and all is well.
2. 
http://velocity.apache.org/engine/releases/velocity-1.7/developer-guide.html#simpleexampleofacustomlogger
 shows how to use a custom Logger.  By calling  
"Velocity.setProperty(Velocity.RUNTIME_LOG_LOGSYSTEM, new
org.apache.velocity.slf4j.Slf4jLogChute())" before calling Velocity.init() 
Velocity will use SLF4J. 
3. The same as item 2 but implement a LogChute for Log4j 2.x.
                
> The Log4j 1.x compatibility bridge does not implement enough of Log4j
> ---------------------------------------------------------------------
>
>                 Key: LOG4J2-97
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-97
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: log4j 1.2 emulation
>    Affects Versions: 2.0-beta2
>            Reporter: Ralph Goers
>
> When running an application the following stack trace was encountered.
> catching java.lang.NoSuchMethodError: 
> org.apache.log4j.Logger.addAppender(Lorg/apache/log4j/Appender;)V
> at 
> org.apache.velocity.runtime.log.Log4JLogChute.initAppender(Log4JLogChute.java:127)
>  ~[velocity-1.7.jar:1.7]
> at org.apache.velocity.runtime.log.Log4JLogChute.init(Log4JLogChute.java:85) 
> ~[velocity-1.7.jar:1.7]
> at 
> org.apache.velocity.runtime.log.LogManager.createLogChute(LogManager.java:157)
>  ~[velocity-1.7.jar:1.7]
> at org.apache.velocity.runtime.log.LogManager.updateLog(LogManager.java:269) 
> ~[velocity-1.7.jar:1.7]
> at 
> org.apache.velocity.runtime.RuntimeInstance.initializeLog(RuntimeInstance.java:871)
>  ~[velocity-1.7.jar:1.7]
> at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:262) 
> ~[velocity-1.7.jar:1.7]
> at 
> org.apache.velocity.runtime.RuntimeSingleton.init(RuntimeSingleton.java:112) 
> ~[velocity-1.7.jar:1.7]
> at org.apache.velocity.app.Velocity.init(Velocity.java:74) 
> ~[velocity-1.7.jar:1.7]
> To be useful the compatibility bridge must provide some sort of support for 
> these kinds of usages.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to