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

Piotr Karwasz commented on LOG4J2-3451:
---------------------------------------

Hi [~Pavel_K],

There are actually two different aspects of this issue:
 # finding plugins in external modules (by any means necessary),
 # supporting the {{packages}} attribute of the configuration to scan for 
classes in external modules.

The first point is already implemented in 3.x: each module containing Log4j2 
plugins must export a `PluginService` (which is created by 
`log4j-plugin-processor`).

I would be rather reluctant to implement the second point: classpath/modulepath 
scanning is a rather heavy process and in a modularized environment it would 
require to open the external module to {{log4j-core}}.

In 2.x there is already a better mechanism: {{log4j-core}} contains a Java 
processor to create a plugin cache. Components in JARs with a plugin cache do 
not require scanning nor providing a {{packages}} attribute. This works 
out-of-the-box on the classpath, but I think it could be easily extended to the 
modulepath.

> Custom appenders on module path must be found
> ---------------------------------------------
>
>                 Key: LOG4J2-3451
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3451
>             Project: Log4j 2
>          Issue Type: Improvement
>    Affects Versions: 2.14.1
>            Reporter: Pavel_K
>            Assignee: Piotr Karwasz
>            Priority: Major
>
> Currently if custom appender is added via config, something like this:
> {code:java}
> <Configuration packages="com.yourcompany.yourcustomappenderpackage">
>   <Appenders>
>     <MyCustomAppender name="ABC" otherAttribute="...">
>     ...
>   </Appenders>
>   <Loggers><Root><AppenderRef ref="ABC" /></Root></Loggers>
> </Configuration>
> {code}
> Log4j2 will find this appender class only if this class is on class path.  I 
> suggest that appenders on module path must also be found.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to