[
https://issues.apache.org/jira/browse/LOG4J2-368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13749675#comment-13749675
]
Gary Gregory commented on LOG4J2-368:
-------------------------------------
Here is the Velocity code:
{code:java}
// This tries to create a file appender for the specified file name.
private void initAppender(String file) throws Exception
{
try
{
// to add the appender
PatternLayout layout = new PatternLayout("%d - %m%n");
this.appender = new RollingFileAppender(layout, file, true);
// if we successfully created the file appender,
// configure it and set the logger to use only it
appender.setMaxBackupIndex(1);
appender.setMaximumFileSize(100000);
// don't inherit appenders from higher in the logger heirarchy
logger.setAdditivity(false);
logger.addAppender(appender);
log(DEBUG_ID, "Log4JLogChute initialized using file '"+file+'\'');
}
catch (IOException ioe)
{
rsvc.getLog().error("Could not create file appender '"+file+'\'',
ioe);
throw ExceptionUtils.createRuntimeException("Error configuring
Log4JLogChute : ", ioe);
}
}
{code}
> PatternLayout in 1.2 bridge missing constructor
> -----------------------------------------------
>
> Key: LOG4J2-368
> URL: https://issues.apache.org/jira/browse/LOG4J2-368
> Project: Log4j 2
> Issue Type: Bug
> Components: log4j 1.2 emulation
> Affects Versions: 2.0-beta8
> Environment: Velocity 1.7 hits this
> Reporter: Gus Heck
>
> java.lang.NoSuchMethodError:
> org.apache.log4j.PatternLayout.<init>(Ljava/lang/String;)V
> at
> org.apache.velocity.runtime.log.Log4JLogChute.initAppender(Log4JLogChute.java:117)
> ~[velocity-1.7-dep.jar:1.7]
> at
> org.apache.velocity.runtime.log.Log4JLogChute.init(Log4JLogChute.java:85)
> ~[velocity-1.7-dep.jar:1.7]
> at
> org.apache.velocity.runtime.log.LogManager.createLogChute(LogManager.java:157)
> ~[velocity-1.7-dep.jar:1.7]
> at
> org.apache.velocity.runtime.log.LogManager.updateLog(LogManager.java:269)
> ~[velocity-1.7-dep.jar:1.7]
> at
> org.apache.velocity.runtime.RuntimeInstance.initializeLog(RuntimeInstance.java:871)
> ~[velocity-1.7-dep.jar:1.7]
> at
> org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:262)
> ~[velocity-1.7-dep.jar:1.7]
> at
> org.apache.velocity.runtime.RuntimeInstance.requireInitialization(RuntimeInstance.java:302)
> ~[velocity-1.7-dep.jar:1.7]
> at
> org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1531)
> ~[velocity-1.7-dep.jar:1.7]
> at
> org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:343)
> ~[velocity-1.7-dep.jar:1.7]
--
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]