karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emily Berk (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (KARAF-5354) log:get and log:set Do Not Work for a etc/log4j2.xml Configuration File
Date Tue, 26 Sep 2017 16:17:00 GMT

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

Emily Berk edited comment on KARAF-5354 at 9/26/17 4:16 PM:
------------------------------------------------------------

[~jbonofre], there appears to be an issue with configuring failover appenders in the {{org.ops4j.pax.logging.cfg}}
file. Or, possibly, we haven't discovered the right syntax.

An attempt to configure a failover like this:
{code}
log4j2.appender.myFailoverAppender.type = Failover
log4j2.appender.myFailoverAppender.name = myFailoverAppender
log4j2.appender.myFailoveAppenderr.primary = myMainAppender
log4j2.appender.myFailoverAppender.failovers.type = Failovers
log4j2.appender.myFailoverAppender.failovers.appenderRef.myBackupAppender.ref = myBackupAppender
{code}
results in an {{ERROR appender Failover has no parameter that matches element Failovers}}
error.

Furthermore, the xml-syntax is a lot easier to read and modify.


was (Author: emily.berk):
[~jbonofre], there appears to be an issue with configuring failover appenders in the {{org.ops4j.pax.logging.cfg}}
file: LOG4J2-1163.

> log:get and log:set Do Not Work for a etc/log4j2.xml Configuration File
> -----------------------------------------------------------------------
>
>                 Key: KARAF-5354
>                 URL: https://issues.apache.org/jira/browse/KARAF-5354
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-logging
>    Affects Versions: 4.1.2
>            Reporter: Emily Berk
>            Assignee: Jean-Baptiste Onofré
>            Priority: Minor
>             Fix For: 4.2.0, 4.1.3
>
>
> Steps to reproduce:
> 1. Replace contents of {{etc/org.ops4j.pax.logging.cfg}} with 
> {code}
> org.ops4j.pax.logging.log4j2.config.file=${karaf.etc}/log4j2.xml
> {code}
> 2. Add an {{etc/log4j2.xml}} configuration file with a configuration like
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> <Configuration status="info">
>     <Appenders>
>         <PaxOsgi name="paxosgi" filter="VmLogAppender"/>
>     </Appenders>
>     <Loggers>
>         <Root level="info">
>             <AppenderRef ref="paxosgi"/>
>         </Root>
>     </Loggers>
> </Configuration>
> {code}
> 3. Start up Karaf.
> Notice that {{log:set}} and {{log:get}} fail with 
> {code}
> 2017-09-07 18:28:39,352 | ERROR | nsole user karaf | ShellUtil                      
 | 42 - org.apache.karaf.shell.core - 4.1.2 | Exception caught while executing command
> java.lang.IllegalStateException: Unrecognized configuration
> 	at org.apache.karaf.log.core.internal.LogServiceImpl.getDelegate(LogServiceImpl.java:55)
[36:org.apache.karaf.log.core:4.1.2]
> 	at org.apache.karaf.log.core.internal.LogServiceImpl.setLevel(LogServiceImpl.java:98)
[36:org.apache.karaf.log.core:4.1.2]
> 	at org.apache.karaf.log.command.SetLogLevel.execute(SetLogLevel.java:48) [36:org.apache.karaf.log.core:4.1.2]
> 	at org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)
[42:org.apache.karaf.shell.core:4.1.2]
> 	at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
[42:org.apache.karaf.shell.core:4.1.2]
> 	at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
[42:org.apache.karaf.shell.core:4.1.2]
> 	at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:571) [42:org.apache.karaf.shell.core:4.1.2]
> 	at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:497) [42:org.apache.karaf.shell.core:4.1.2]
> 	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:386) [42:org.apache.karaf.shell.core:4.1.2]
> 	at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:417) [42:org.apache.karaf.shell.core:4.1.2]
> 	at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) [42:org.apache.karaf.shell.core:4.1.2]
> 	at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) [42:org.apache.karaf.shell.core:4.1.2]
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
> 	at java.lang.Thread.run(Thread.java:745) [?:?]
> {code}
> {{log:set}} and {{log:get}} should behave the same when using the {{log4j2.xml}} configuration
as when using the {{org.ops4j.pax.logging.cfg}} configuration.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message