Karaf 4.1.5 and log configuration

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Karaf 4.1.5 and log configuration

afbagwe
We use a log4j2.xml file in our Karaf configuration (that we point to from
the pax logging cfg file). When we tested it with Karaf 4.1.5, we got the
following error doing log:tail

28-Feb-2018 13:00:12.613 [ERROR] nsole user admin | ShellUtil            |
76 - org.apache.karaf.shell.core - 4.1.5 | Exception caught while executing
command
java.lang.IllegalStateException: Unrecognized configuration
        at
org.apache.karaf.log.core.internal.LogServiceImpl.getDelegate(LogServiceImpl.java:55)
[67:org.apache.karaf.log.core:4.1.5]
        at
org.apache.karaf.log.core.internal.LogServiceImpl.getLevel(LogServiceImpl.java:73)
[67:org.apache.karaf.log.core:4.1.5]
        at
org.apache.karaf.log.command.LogTail$LogServiceTracker.addingService(LogTail.java:94)
[67:org.apache.karaf.log.core:4.1.5]
        at
org.apache.karaf.log.command.LogTail$LogServiceTracker.addingService(LogTail.java:76)
[67:org.apache.karaf.log.core:4.1.5]
        at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
[?:?]
        at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870)
[?:?]
        at
org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
[?:?]
        at
org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)
[?:?]
        at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:318) [?:?]
        at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261) [?:?]
        at org.apache.karaf.log.command.LogTail.execute(LogTail.java:54)
[67:org.apache.karaf.log.core:4.1.5]
        at
org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)
[76:org.apache.karaf.shell.core:4.1.5]
        at
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
[76:org.apache.karaf.shell.core:4.1.5]
        at
org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
[76:org.apache.karaf.shell.core:4.1.5]
        at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:571)
[76:org.apache.karaf.shell.core:4.1.5]
        at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:497)
[76:org.apache.karaf.shell.core:4.1.5]
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:386)
[76:org.apache.karaf.shell.core:4.1.5]
        at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:417)
[76:org.apache.karaf.shell.core:4.1.5]
        at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229)
[76:org.apache.karaf.shell.core:4.1.5]
        at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59)
[76:org.apache.karaf.shell.core:4.1.5]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
        at java.util.concurrent.ThreadPoolExecutocd
r.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

We didn't change our XML except to add in the 'org.apache.sshd' logger and
it works fine in 4.1.4

I can't post the XML here without borking the web form. But can anyone
hazard a guess as to why this might happen?






--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.1.5 and log configuration

afbagwe
This post was updated on .
Here's the XML config we are using:

<Configuration>
   <Properties>
      <Property name="layout">%d{dd-MMM-yyyy HH:mm:ss.SSS} [%-5.5p] %-16.16t | %-20.20c{1} | %X{bundle.id} -%X{bundle.name} - %X{bundle.version} | %m%n</Property>
   </Properties>
   <Appenders>
      <Console name="Console">
         <PatternLayout pattern="${layout}"/>
      </Console>


      <RollingRandomAccessFile name="KARAF_LOG_FILE" append="true"
                               fileName="${sys:karaf.data}/log/karaf.log"
                               filePattern="${sys:karaf.data}/log/karaf.log.%i">
         <PatternLayout pattern="${layout}"/>
         <Policies>
            <SizeBasedTriggeringPolicy size="16MB"/>
         </Policies>
      </RollingRandomAccessFile>

      <RollingRandomAccessFile name="AUDIT_LOG_FILE" append="true"
                               fileName="${sys:karaf.data}/log/security-audit.log"
                               filePattern="${sys:karaf.data}/log/security-audit.log.%i">
         <PatternLayout pattern="${layout}"/>
         <Policies>
            <SizeBasedTriggeringPolicy size="16MB"/>
         </Policies>
      </RollingRandomAccessFile>


      <PaxOsgi name="PAX_OSGI" filter="*"/>


   </Appenders>
   <Loggers>

      <Logger name="org.apache.aries.spifly" level="warn" additivity="false">
         <AppenderRef ref="KARAF_LOG_FILE"/>
      </Logger>

      <Logger name="org.apache.sshd" level="info" additivity="false">
         <AppenderRef ref="KARAF_LOG_FILE"/>
      </Logger>


      <Logger name="org.apache.karaf.jaas.modules.audit" level="info" additivity="false">
         <AppenderRef ref="AUDIT_LOG_FILE"/>
      </Logger>


      <Root level="info">
         <AppenderRef ref="KARAF_LOG_FILE"/>
         <AppenderRef ref="PAX_OSGI"/>
      </Root>
   
   </Loggers>
</Configuration>
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.1.5 and log configuration

jbonofre
In reply to this post by afbagwe
Hi

We didn't change the Pax Logging (Log4j2) version between 4.1.4 and 4.1.5.

Maybe we introduced a regression due to KARAF-5528 even if it looks unrelated.

However, the issue seems to come from karaf log, not pax logging directly. The
change can cause the issue is KARAF-5559.
In order to avoid infinite loop, log:display & log:tail commands now tries to
change the log level of sshd to error (when it's debug).

When do you have this exception ? At startup or when you perform
log:tail/log:display ?

Regards
JB

On 02/28/2018 10:53 PM, afbagwe wrote:

> We use a log4j2.xml file in our Karaf configuration (that we point to from
> the pax logging cfg file). When we tested it with Karaf 4.1.5, we got the
> following error doing log:tail
>
> 28-Feb-2018 13:00:12.613 [ERROR] nsole user admin | ShellUtil            |
> 76 - org.apache.karaf.shell.core - 4.1.5 | Exception caught while executing
> command
> java.lang.IllegalStateException: Unrecognized configuration
> at
> org.apache.karaf.log.core.internal.LogServiceImpl.getDelegate(LogServiceImpl.java:55)
> [67:org.apache.karaf.log.core:4.1.5]
> at
> org.apache.karaf.log.core.internal.LogServiceImpl.getLevel(LogServiceImpl.java:73)
> [67:org.apache.karaf.log.core:4.1.5]
> at
> org.apache.karaf.log.command.LogTail$LogServiceTracker.addingService(LogTail.java:94)
> [67:org.apache.karaf.log.core:4.1.5]
> at
> org.apache.karaf.log.command.LogTail$LogServiceTracker.addingService(LogTail.java:76)
> [67:org.apache.karaf.log.core:4.1.5]
> at
> org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
> [?:?]
> at
> org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870)
> [?:?]
> at
> org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
> [?:?]
> at
> org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)
> [?:?]
> at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:318) [?:?]
> at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261) [?:?]
> at org.apache.karaf.log.command.LogTail.execute(LogTail.java:54)
> [67:org.apache.karaf.log.core:4.1.5]
> at
> org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84)
> [76:org.apache.karaf.shell.core:4.1.5]
> at
> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68)
> [76:org.apache.karaf.shell.core:4.1.5]
> at
> org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86)
> [76:org.apache.karaf.shell.core:4.1.5]
> at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:571)
> [76:org.apache.karaf.shell.core:4.1.5]
> at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:497)
> [76:org.apache.karaf.shell.core:4.1.5]
> at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:386)
> [76:org.apache.karaf.shell.core:4.1.5]
> at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:417)
> [76:org.apache.karaf.shell.core:4.1.5]
> at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229)
> [76:org.apache.karaf.shell.core:4.1.5]
> at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59)
> [76:org.apache.karaf.shell.core:4.1.5]
> at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
> at java.util.concurrent.ThreadPoolExecutocd
> r.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
>
> We didn't change our XML except to add in the 'org.apache.sshd' logger and
> it works fine in 4.1.4
>
> I can't post the XML here without borking the web form. But can anyone
> hazard a guess as to why this might happen?
>
>
>
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.1.5 and log configuration

afbagwe

Whenever I perform the client log commands. There's no indication of a
problem immediately after startup if I examine the log outside of Karaf.

-A



jbonofre wrote

> Hi
>
> We didn't change the Pax Logging (Log4j2) version between 4.1.4 and 4.1.5.
>
> Maybe we introduced a regression due to KARAF-5528 even if it looks
> unrelated.
>
> However, the issue seems to come from karaf log, not pax logging directly.
> The
> change can cause the issue is KARAF-5559.
> In order to avoid infinite loop, log:display & log:tail commands now tries
> to
> change the log level of sshd to error (when it's debug).
>
> When do you have this exception ? At startup or when you perform
> log:tail/log:display ?
>
> Regards
> JB
>
> --
> Jean-Baptiste Onofré

> jbonofre@

> http://blog.nanthrax.net
> Talend - http://www.talend.com





--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.1.5 and log configuration

jbonofre
OK, so, it's probably due to the workaround I did for log:display and log:tail
commands.

Let me take a look.

Thanks for the report !

Regards
JB

On 03/01/2018 07:06 PM, afbagwe wrote:

>
> Whenever I perform the client log commands. There's no indication of a
> problem immediately after startup if I examine the log outside of Karaf.
>
> -A
>
>
>
> jbonofre wrote
>> Hi
>>
>> We didn't change the Pax Logging (Log4j2) version between 4.1.4 and 4.1.5.
>>
>> Maybe we introduced a regression due to KARAF-5528 even if it looks
>> unrelated.
>>
>> However, the issue seems to come from karaf log, not pax logging directly.
>> The
>> change can cause the issue is KARAF-5559.
>> In order to avoid infinite loop, log:display & log:tail commands now tries
>> to
>> change the log level of sshd to error (when it's debug).
>>
>> When do you have this exception ? At startup or when you perform
>> log:tail/log:display ?
>>
>> Regards
>> JB
>>
>> --
>> Jean-Baptiste Onofré
>
>> jbonofre@
>
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
>
>
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.1.5 and log configuration

afbagwe
Hi JB.

It looks like this problem is still present in the newly released Karaf
4.2.0

Thanks,
-A



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.1.5 and log configuration

afbagwe
In reply to this post by afbagwe
Any idea when this might be fixed? We'd like to upgrade our Karaf version but
our project managers don't want to have to change their log4j2 files to a
different format.



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.1.5 and log configuration

jbonofre
Hi,

sorry I'm late on this one.

Did you create a Jira with your log4j2 configuration ?

Regards
JB

On 11/09/2018 17:37, afbagwe wrote:
> Any idea when this might be fixed? We'd like to upgrade our Karaf version but
> our project managers don't want to have to change their log4j2 files to a
> different format.
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.1.5 and log configuration

afbagwe