You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Ralph Goers (JIRA)" <ji...@apache.org> on 2019/06/18 04:45:00 UTC

[jira] [Comment Edited] (LOG4J2-2600) Declarative Groovy Configuration DSL

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

Ralph Goers edited comment on LOG4J2-2600 at 6/18/19 4:44 AM:
--------------------------------------------------------------

With your work on this issue are you running into the issues mentioned in LOG4J2-1531?


was (Author: ralph.goers@dslextreme.com):
With your work on this issue are you running into the issues mentioned in LOG4J2-1521?

> Declarative Groovy Configuration DSL
> ------------------------------------
>
>                 Key: LOG4J2-2600
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2600
>             Project: Log4j 2
>          Issue Type: New Feature
>          Components: Configurators
>            Reporter: Matt Sicker
>            Assignee: Matt Sicker
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Borrowing the general Groovy syntax used in [Stapler|https://github.com/stapler/stapler/tree/master/groovy/src/main/java/org/kohsuke/stapler/jelly/groovy], a declarative Groovy syntax comparable to the existing XML/JSON/YAML syntax tree for writing configuration files.
> For example, a minimal binding implementation might look something like this. Starting with an example XML configuration:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <Configuration status="WARN">
>   <Appenders>
>     <Console name="Console" target="SYSTEM_OUT">
>       <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
>     </Console>
>   </Appenders>
>   <Loggers>
>     <Logger name="com.foo.Bar" level="trace">
>       <AppenderRef ref="Console"/>
>     </Logger>
>     <Root level="error">
>       <AppenderRef ref="Console"/>
>     </Root>
>   </Loggers>
> </Configuration>
> {code}
> This would look like this in the declarative Groovy DSL:
> {code:groovy}
> configuration(status: 'warn') {
>   appenders {
>     console(name: 'Console', target: 'SYSTEM_OUT') {
>       patternLayout(pattern: '%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n')
>     }
>   }
>   loggers {
>     logger(name: 'com.foo.Bar', level: 'trace') {
>       appenderRef(ref: 'Console')
>     }
>     root(level: 'error') {
>       appenderRef(ref: 'Console')
>     }
>   }
> }
> {code}
> While it is not the goal of this particular feature to enable scripted configuration, it does open the possibility for such.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)