You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Matt Sicker (Jira)" <ji...@apache.org> on 2019/10/06 18:04:00 UTC
[jira] [Commented] (LOG4J2-2693) @PluginValue does not support
attribute names besides "value"
[ https://issues.apache.org/jira/browse/LOG4J2-2693?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16945417#comment-16945417 ]
Matt Sicker commented on LOG4J2-2693:
-------------------------------------
I have a fix for this in my refactoring for the master branch. I still need to backport the fix minus the refactoring for release-2.x, though that should be fairly simple.
> @PluginValue does not support attribute names besides "value"
> -------------------------------------------------------------
>
> Key: LOG4J2-2693
> URL: https://issues.apache.org/jira/browse/LOG4J2-2693
> Project: Log4j 2
> Issue Type: Bug
> Components: Plugins
> Affects Versions: 2.12.1
> Reporter: Matt Sicker
> Assignee: Matt Sicker
> Priority: Major
>
> While working in the plugin system recently, I discovered an inconsistent behavior in how {{@PluginValue}} works compared to {{@PluginAttribute}}. If a {{value}} is specified other than "value", then I'd expect that the contents of that value to be the attribute name in the configuration file.
> For example:
> {code:java}
> @Plugin(name = "Foo", category = "Core", ...)
> public class Foo {
> // ...
> @PluginFactory
> public static Foo createFoo(@PluginValue("bar") String bar) {
> return new Foo(bar);
> }
> }
> {code}
> Expected XML config:
> {code:xml}
> <Foo bar="baz"/>
> {code}
> Actual XML config:
> {code:xml}
> <Foo value="baz"/>
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)