You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Frank Conover (JIRA)" <ji...@apache.org> on 2016/09/26 23:12:20 UTC

[jira] [Commented] (LOG4J2-741) Reinstate the package attribute for discovering custom plugins

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

Frank Conover commented on LOG4J2-741:
--------------------------------------

I am experiencing this issue with 2.6.3 and I tried 2.3. I have a custom plugin in a jar file. Works fine from eclipse, or a non-jar java app but not as a jar project. I have packages="... attribute filled out in my log4j2.xml. I added it to get the custom appender found while running from eclipse. As a non-maven program using jars which are on the classpath the appender is not found.  Is there another way I should be doing this? Is packages still fixed / or still an available feature?
Note: If I extract my jars and run, the appender is found.

The stack overflow link in the description sounds like my issue. Do I need to compile with a certain flag turned on? Generate my jar a certain way?

> Reinstate the package attribute for discovering custom plugins
> --------------------------------------------------------------
>
>                 Key: LOG4J2-741
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-741
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 2.0-rc2, 2.0
>            Reporter: Remko Popma
>            Assignee: Remko Popma
>            Priority: Blocker
>             Fix For: 2.0.1
>
>         Attachments: LOG4J2-741-patch.txt
>
>
> Several people reported problems with their custom plugins no longer being recognized by log4j2. See LOG4J2-673 and [this StackOverflow question|http://stackoverflow.com/questions/24918810/log4j2-configuration-will-not-load-custom-pattern-converter].
> Plugins created before the annotation processor was added to log4j2 (all plugins created with 2.0-rc1 and earlier) may not have a {{META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat}} file.
> Previously plugins without this metadata file could still be found if the user specified their custom plugin package(s) in the {{packages}} attribute of the {{<Configuration>}} element in their log4j2.xml configuration file.
> However, since 2.0-rc2, the {{packages}} configuration attribute was disabled; users may still specify a value, but log4j2 will no longer use this value to try to load custom plugins. This causes problems for custom plugins built before the annotation processor was added to log4j2, as well as custom plugins that are built in an environment where the annotation processor does not work (for example, most IDEs require some setting changes to enable annotation processing).
> This Jira ticket is to reactivate the packages configuration attribute. 



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