logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Gacki (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (LOG4J2-931) ConsoleAppender is missing @PluginFactory annotation at createAppender method
Date Fri, 09 Jan 2015 22:10:34 GMT

     [ https://issues.apache.org/jira/browse/LOG4J2-931?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Robert Gacki closed LOG4J2-931.
-------------------------------

Verified in master. Thank you.

> ConsoleAppender is missing @PluginFactory annotation at createAppender method
> -----------------------------------------------------------------------------
>
>                 Key: LOG4J2-931
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-931
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 2.1
>            Reporter: Robert Gacki
>             Fix For: 2.2
>
>
> I use the JUL Adapter and when j.u.l.Loggers are loaded, I get the following exception
> {noformat}
> 2014-12-28 23:01:44,113 ERROR Unable to invoke factory method in class class org.apache.logging.log4j.core.appender.ConsoleAppender
for element Console. java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.ConsoleAppender
> 	at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.findFactoryMethod(PluginBuilder.java:226)
> 	at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:133)
> 	at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:766)
> 	at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:706)
> 	at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:698)
> 	at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:358)
> 	at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:161)
> 	at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:359)
> 	at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:420)
> 	at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:138)
> 	at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:147)
> 	at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:41)
> 	at org.apache.logging.log4j.LogManager.getContext(LogManager.java:175)
> 	at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:102)
> 	at org.apache.logging.log4j.jul.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:34)
> 	at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:42)
> 	at org.apache.logging.log4j.jul.LogManager.getLogger(LogManager.java:89)
> 	at java.util.logging.LogManager.demandLogger(LogManager.java:551)
> 	at java.util.logging.Logger.demandLogger(Logger.java:455)
> 	at java.util.logging.Logger.getLogger(Logger.java:502)
> 	at org.bson.BSON.<clinit>(BSON.java:37)
> 	at com.mongodb.Mongo.<clinit>(Mongo.java:74)
> 	...
> {noformat}
> The failing code tries to resolve the @PluginFactory annotated method, which is missing
for the ConsoleAppender class.
> FileAppender's method is annotated and it works as expected. So I use this as workaround.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
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