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/09/15 18:57:00 UTC

[jira] [Created] (LOG4J2-2693) @PluginValue does not support attribute names besides "value"

Matt Sicker created LOG4J2-2693:
-----------------------------------

             Summary: @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


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.2#803003)