You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/04/12 20:59:00 UTC

[jira] [Work logged] (LOG4J2-2600) Declarative Groovy Configuration DSL

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

ASF GitHub Bot logged work on LOG4J2-2600:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 12/Apr/20 20:58
            Start Date: 12/Apr/20 20:58
    Worklog Time Spent: 10m 
      Work Description: rgoers commented on issue #274: [LOG4J2-2600] Add declarative Groovy configuration DSL
URL: https://github.com/apache/logging-log4j2/pull/274#issuecomment-612675042
 
 
   Closing per @jvz so I don't keep looking at it.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 421003)
    Time Spent: 40m  (was: 0.5h)

> 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: 40m
>  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
(v8.3.4#803005)