logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remko Popma (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (LOG4J2-741) Reinstate the package attribute for discovering custom plugins
Date Sat, 26 Jul 2014 13:00:41 GMT

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

Remko Popma resolved LOG4J2-741.
--------------------------------

    Resolution: Fixed

Fixed in revision 1613615.

Added a JUnit test with a custom plugin loaded via a configuration file with the packages
attribute, but reviews would be great. 

For example, I reverted back the old code in {{PluginManager.addPackages()}} that looks like
this:
{code}
public static void addPackage(final String p) {
    if (PACKAGES.addIfAbsent(p)) {
        // set of available plugins could have changed, reset plugin cache for newly-retrieved
managers
        REGISTRY.clear(); // TODO confirm if this is correct
    }
}
{code}

Should the REGISTRY really be cleared here? This removes all plugins found in Log4j2Plugins.dat
files earlier. I am not sure if this is a problem because as far as I can tell the {{addPackages}}
method is called first, before the {{loadPlugins}} method.

> 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, 2.0-rc2
>            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.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