You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ppkarwasz (via GitHub)" <gi...@apache.org> on 2024/10/27 20:50:44 UTC

[I] Plugins should either have a builder or a factory method (logging-log4j2)

ppkarwasz opened a new issue, #3126:
URL: https://github.com/apache/logging-log4j2/issues/3126

   Log4j plugin should either have a builder annotated with `@PluginBuilderFactory` or a factory method annotated with `@PluginFactory`. As it turns out, some of them have both, for example `PatternLayout`:
   
   https://github.com/apache/logging-log4j2/blob/f786b51c3ef32e460bb6fedf21e9de90caff881e/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java#L301-L303
   
   https://github.com/apache/logging-log4j2/blob/f786b51c3ef32e460bb6fedf21e9de90caff881e/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/PatternLayout.java#L624-L625
   
   This rule should probably be enforced by the annotation processor.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Plugins should either have a builder or a factory method (logging-log4j2)

Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on issue #3126:
URL: https://github.com/apache/logging-log4j2/issues/3126#issuecomment-2441744823

   > @ppkarwasz, agreed that one should be present, but since `PBF` was introduced after `PF`, it is inevitable that some classes have both, and I don't know of a way to fix this without breaking backward compatibility. Do you?
   
   I am not suggesting removing the factory methods, just the annotations (this is a `MICRO` change AFAIK). Having two annotations on the same class might lead to non deterministic behavior.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Plugins should either have a builder or a factory method (logging-log4j2)

Posted by "vy (via GitHub)" <gi...@apache.org>.
vy commented on issue #3126:
URL: https://github.com/apache/logging-log4j2/issues/3126#issuecomment-2441709295

   @ppkarwasz, agreed that one should be present, but since `PBF` was introduced after `PF`, it is inevitable that some classes have both, and I don't know of a way to fix this without breaking backward compatibility. Do you?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org