[
https://issues.apache.org/jira/browse/LOG4J2-501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13925576#comment-13925576
]
Carfield Yim commented on LOG4J2-501:
-------------------------------------
HI, I change to use log4j-core-2.0-rc2-20140308.025246-29.jar and
log4j-api-2.0-rc2-20140308.025245-29.jar, with following log4j2.json, But it
still doesn't work...
{code}{ "configuration": {
"appenders": {
"RandomAccessFile": { "name": "FILE", "fileName": "app.log",
"PatternLayout": { "pattern": "%d %p %c{1.} [%t] %m%n" }
},
"Console": { "name": "STDOUT",
"PatternLayout": { "pattern": "%m%n" }
}
},
"loggers" : {
"root" : { "level" : "trace", "AppenderRef" : [{"ref" : "STDOUT"},
{"ref" : "FILE"}]}
}
}}
{code}
> Issue on config log4j2 with JSON
> --------------------------------
>
> Key: LOG4J2-501
> URL: https://issues.apache.org/jira/browse/LOG4J2-501
> Project: Log4j 2
> Issue Type: Bug
> Components: Configurators
> Affects Versions: 2.0-beta9
> Environment: Windows 7
> Reporter: Carfield Yim
> Priority: Minor
>
> I have below simple config for log4j2 which just log the message to console
> stdout and a file:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <Configuration>
> <Appenders>
> <RandomAccessFile name="FILE" fileName="app.log">
> <PatternLayout>
> <Pattern>%d %p %c{1.} [%t] %m%n</Pattern>
> </PatternLayout>
> </RandomAccessFile>
> <Console name="STDOUT" target="SYSTEM_OUT">
> <PatternLayout pattern="%m%n" />
> </Console>
> </Appenders>
> <Loggers>
> <Root level="trace">
> <AppenderRef ref="FILE" />
> <AppenderRef ref="STDOUT" />
> </Root>
> </Loggers>
> </Configuration>
> {code}
> It working fine, but if I change to JSON config, it doesn't work, Someone
> suggest it maybe a bug
> {code}
> { "configuration":
> {
> "appenders": {
> "RandomAccessFile": { "name": "FILE", "fileName": "app.log",
> "PatternLayout": { "pattern": "%d %p %c{1.} [%t] %m%n" }
> },
> "Console": { "name": "STDOUT",
> "PatternLayout": { "pattern": "%m%n" }
> }
> },
> "loggers": {
> "root": { "level": "trace",
> "AppenderRef": { "ref": "STDOUT" },
> "AppenderRef": { "ref": "FILE" }
> }
> }
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]