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/21 17:02:00 UTC

[jira] [Commented] (LOG4J2-2647) Validation blocks definition of script in properties configuration

    [ https://issues.apache.org/jira/browse/LOG4J2-2647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16935091#comment-16935091 ] 

Matt Sicker commented on LOG4J2-2647:
-------------------------------------

I think this is related to LOG4J2-2693.

> Validation blocks definition of script in properties configuration
> ------------------------------------------------------------------
>
>                 Key: LOG4J2-2647
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2647
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Configurators
>    Affects Versions: 2.12.0
>            Reporter: Daniel Skovenborg
>            Priority: Minor
>
> Creating a script in a properties configuration is undocumented but is supported by PropertiesConfigurationBuilder:
> {code:java}
>     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");
> {code}
> 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):
> {code:java}
> script.foo.type=Script
> script.foo.name=foo
> script.foo.language=javascript
> script.foo.text=true
> {code}
> This gives the following errors:
> {quote}Script contains an invalid element or attribute "text"
> No 'scriptText' attribute provided for Script plugin 'uuid'
> {quote}
> Using "scriptText" as key is not accepted either.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)