[prev in list] [next in list] [prev in thread] [next in thread] 

List:       log4j-dev
Subject:    [jira] [Resolved] (LOG4J2-464) JSON Syntax: LoggerConfig - multiple AppenderRef entries
From:       "Ralph Goers (JIRA)" <jira () apache ! org>
Date:       2013-12-28 6:33:50
Message-ID: JIRA.12683995.1386752106093.17834.1388212430580 () arcas
[Download RAW message or body]


     [ https://issues.apache.org/jira/browse/LOG4J2-464?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel \
]

Ralph Goers resolved LOG4J2-464.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0-rc1

Fixed in revision 1553789. You can now specifiy

{code}
"AppenderRef": [{ "ref": "LIST1", "level": "warn" }, {"ref": "LIST2", "level": \
"debug"}] {code}

in addition to

{code}
"AppenderRef": {"ref": "LIST1", "level": "trace"}
{code}

Please verify and close.

> JSON Syntax: LoggerConfig - multiple AppenderRef entries
> --------------------------------------------------------
> 
> Key: LOG4J2-464
> URL: https://issues.apache.org/jira/browse/LOG4J2-464
> Project: Log4j 2
> Issue Type: Question
> Components: Configurators
> Affects Versions: 2.0-beta9
> Environment: Eclipse Juno
> Windows
> Reporter: James Pretorius
> Labels: appender-ref, appenderref, json, logger, multiple
> Fix For: 2.0-rc1
> 
> 
> How does one assign multiple AppenderRef entries to a logger when using JSON \
> syntax? I've tried numerous formats but none of them appear to work. Exampe below. \
> "loggers": { "logger": [
> {
> "name": "helloWorld",
> "level": "info",
> "additivity": "true",
> "AppenderRef": [
> {
> "ref": "File Routing Appender"
> },
> {
> "ref": "Database Routing Appender"
> }
> ]
> }
> ],
> "root": {
> "level": "info",
> "AppenderRef": {
> "ref": "Console Appender"
> }
> }
> }
> 2013-12-11 08:32:07,012 DEBUG Calling createLogger on class \
> org.apache.logging.log4j.core.config.LoggerConfig for element logger with \
> params(additivity="true", level="info", name="helloWorld", includeLocation="null", \
> AppenderRef={}, Properties={}, Configuration(Hello World Config), null) The only \
> way I've been able to hack this (up to a maximum of two AppenderRefs) is to use the \
> appender-ref alias in conjunction with AppenderRef e.g.: "loggers": {
> "logger": [
> 
> {
> "name": "helloWorld",
> "level": "info",
> "additivity": "true",
> "AppenderRef": {
> 	"ref":"File Routing Appender"
> },
> "appender-ref": {
> 	"ref":"Database Routing Appender"
> }
> }
> ],
> "root": {
> "level": "info",
> "AppenderRef": {
> "ref": "Console Appender"
> }
> }
> 		}
> 2013-12-11 08:51:54,977 DEBUG Calling createLogger on class \
> org.apache.logging.log4j.core.config.LoggerConfig for element logger with \
> params(additivity="true", level="info", name="helloWorld", includeLocation="null", \
> AppenderRef={File Routing Appender, Database Routing Appender}, Properties={}, \
> Configuration(Hello World Config), null)



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic