You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Jean-Baptiste Onofré (JIRA)" <ji...@apache.org> on 2019/07/25 14:22:00 UTC

[jira] [Resolved] (KARAF-5650) Getting exception while using log:get and log:set command in karaf 4.1.4

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

Jean-Baptiste Onofré resolved KARAF-5650.
-----------------------------------------
    Resolution: Duplicate

> Getting exception while using log:get and log:set command in karaf 4.1.4
> ------------------------------------------------------------------------
>
>                 Key: KARAF-5650
>                 URL: https://issues.apache.org/jira/browse/KARAF-5650
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf
>    Affects Versions: 4.1.4
>            Reporter: vijay p 
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>
> {code}
> log:get
> 10:06:54.457 [Karaf ssh console user root] ERROR org.apache.karaf.shell.support.ShellUtil - Exception caught while executing command
>                                                                                                                                     java.lang.IllegalStateException: Unrecognized configuration
>                                 at org.apache.karaf.log.core.internal.LogServiceImpl.getDelegate(LogServiceImpl.java:55) [50:org.apache.karaf.log.core:4.1.4]
>                                                                                                                                                                 at org.apache.karaf.log.core.internal.LogServiceImpl.getLevel(LogServiceImpl.java:73) [50:org.apache.karaf.log.core:4.1.4]
>                                                                                                                         at org.apache.karaf.log.command.GetLogLevel.execute(GetLogLevel.java:49) [50:org.apache.karaf.log.core:4.1.4]
>                                                                 at org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84) [59:org.apache.karaf.shell.core:4.1.4]
>                                 at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68) [59:org.apache.karaf.shell.core:4.1.4]
>         at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86) [59:org.apache.karaf.shell.core:4.1.4]
>                                                                                                                                                         at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:571) [59:org.apache.karaf.shell.core:4.1.4]
>                                                                                                 at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:497) [59:org.apache.karaf.shell.core:4.1.4]
>                                                 at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:386) [59:org.apache.karaf.shell.core:4.1.4]
>                                                                                                                                                                 at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:417) [59:org.apache.karaf.shell.core:4.1.4]
>                                                                                                 at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) [59:org.apache.karaf.shell.core:4.1.4]
>                                 at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) [59:org.apache.karaf.shell.core:4.1.4]
>                                                                                                                                 at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
>                                 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
>                                                                                                                                 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
>                                                         at java.lang.Thread.run(Thread.java:748) [?:?]
>                                                                                                       Error executing command: Unrecognized configuration
> {code}
> I would like to know is there support for logback? I had a configuration file that was previously working for Karaf 3.0.6 but get an Unrecognized Configuration while I make use of the same configuration file in Karaf 4.1.4
> I have appended the configuration that I have in my logback.xml.
> {code}
> <?xml version="1.0" encoding="UTF-8" ?>
> <configuration>
>     <appender name="OSGI-BUNDLE-FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
>         <file>/var/opt/log/Karaf.log</file>
>         <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
>             <fileNamePattern>/var/opt/log/Karaf.log.%i</fileNamePattern>
>             <minIndex>1</minIndex>
>             <maxIndex>5</maxIndex>
>         </rollingPolicy>
>         <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
>             <maxFileSize>5MB</maxFileSize>
>         </triggeringPolicy>
>         <encoder>
>             <pattern>%d{yyyy-MM-dd'T'HH:mm:ss.SSSZ} | %-5.5p | %-16.16t | %-32.32c{1} | %-32.32C %4L | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n</pattern>
>         </encoder>
>     </appender>
>     <root level="ERROR">
>         <appender-ref ref="OSGI-BUNDLE-FILE" />
>     </root>
>     <!--Since we have only one appender, there is no need to specify appender
>         but if we have a new appender in future, we don't need to change this logger
>     -->
>     <logger name="com.oam" level="ERROR" additivity="false">
>         <appender-ref ref="OSGI-BUNDLE-FILE" />
>     </logger>
>     <logger name="com.osgi" level="ERROR" additivity="false">
>         <appender-ref ref="OSGI-BUNDLE-FILE" />
>     </logger>
>     <logger name="com.lm" level="ERROR" additivity="false">
>         <appender-ref ref="OSGI-BUNDLE-FILE" />
>     </logger>
>     <logger name="com" level="ERROR" />
> </configuration>
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)