Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-2693

@PluginValue does not support attribute names besides "value"

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.12.1
    • Fix Version/s: 3.0.0, 2.13.0
    • Component/s: Plugins
    • Labels:
      None

      Description

      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:

      @Plugin(name = "Foo", category = "Core", ...)
      public class Foo {
      // ...
      @PluginFactory
      public static Foo createFoo(@PluginValue("bar") String bar) {
        return new Foo(bar);
      }
      }
      

      Expected XML config:

      <Foo bar="baz"/>
      

      Actual XML config:

      <Foo value="baz"/>
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mattsicker Matt Sicker
                Reporter:
                mattsicker Matt Sicker
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: