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

Validation blocks definition of script in properties configuration

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.12.0
    • 2.13.0
    • Configurators
    • None

    Description

      Creating a script in a properties configuration is undocumented but is supported by PropertiesConfigurationBuilder:

          private ScriptComponentBuilder createScript(final Properties properties) {
              final String name = (String) properties.remove("name");
              final String language = (String) properties.remove("language");
              final String text = (String) properties.remove("text");
      

      So I should be able to specify the code with the "text" key. However, validation is blocking this feature. I've tried this (script content omitted):

      script.foo.type=Script
      script.foo.name=foo
      script.foo.language=javascript
      script.foo.text=true
      

      This gives the following errors:

      Script contains an invalid element or attribute "text"

      No 'scriptText' attribute provided for Script plugin 'uuid'

      Using "scriptText" as key is not accepted either.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: