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

@PluginValue does not support attribute names besides "value"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.12.1
    • 3.0.0, 2.13.0
    • Plugins
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: