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 20:26:00 UTC

[jira] [Resolved] (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:all-tabpanel ]

Matt Sicker resolved LOG4J2-2693.
---------------------------------
    Fix Version/s: 2.13.0
       Resolution: Fixed

Backported to release-2.x.

> @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
>             Fix For: 3.0.0, 2.13.0
>
>
> 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)