karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Grzegorz Grzybek (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KARAF-5116) Defining karaf.log.console as a log4j2 log level causes exceptions
Date Tue, 04 Jul 2017 11:16:00 GMT

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

Grzegorz Grzybek commented on KARAF-5116:
-----------------------------------------

Log4j levels may be used as well. And it's actually recommended (and described in manual)
to use them, because the same property is referenced for log4j2 configuration in {{etc/org.ops4j.pax.logging.cfg}}:
{noformat}
log4j2.rootLogger.appenderRef.Console.filter.threshold.type = ThresholdFilter
log4j2.rootLogger.appenderRef.Console.filter.threshold.level = ${karaf.log.console:-OFF}
{noformat}


> Defining karaf.log.console as a log4j2 log level causes exceptions
> ------------------------------------------------------------------
>
>                 Key: KARAF-5116
>                 URL: https://issues.apache.org/jira/browse/KARAF-5116
>             Project: Karaf
>          Issue Type: Bug
>    Affects Versions: 4.1.1
>            Reporter: Jamie Kemp
>            Assignee: Grzegorz Grzybek
>            Priority: Minor
>             Fix For: 4.2.0, 4.1.2
>
>
> Running karaf 4.1.1, defining karaf.log.console as DEBUG to switch on the console appender
(to get to logging when running under pax-exam) results in the following exceptions:
> {code}
> java.lang.IllegalArgumentException: Bad level "DEBUG"
>         at java.util.logging.Level.parse(Level.java:482)
>         at org.apache.karaf.main.util.BootstrapLogManager.getDefaultHandlersInternal(BootstrapLogManager.java:109)
>         at org.apache.karaf.main.util.BootstrapLogManager.getDefaultHandlers(BootstrapLogManager.java:70)
>         at org.apache.karaf.main.util.BootstrapLogManager.configureLogger(BootstrapLogManager.java:75)
>         at org.apache.karaf.main.Main.launch(Main.java:244)
>         at org.apache.karaf.main.Main.main(Main.java:178)
> java.lang.IllegalArgumentException: Bad level "DEBUG"
>         at java.util.logging.Level.parse(Level.java:482)
>         at org.apache.karaf.main.util.BootstrapLogManager.getDefaultHandlersInternal(BootstrapLogManager.java:109)
>         at org.apache.karaf.main.util.BootstrapLogManager.getDefaultHandlers(BootstrapLogManager.java:70)
>         at org.apache.karaf.main.util.BootstrapLogManager.configureLogger(BootstrapLogManager.java:75)
>         at org.apache.karaf.main.KarafActivatorManager.<init>(KarafActivatorManager.java:49)
>         at org.apache.karaf.main.Main.launch(Main.java:280)
>         at org.apache.karaf.main.Main.main(Main.java:178)
> java.lang.IllegalArgumentException: Bad level "DEBUG"
>         at java.util.logging.Level.parse(Level.java:482)
>         at org.apache.karaf.main.util.BootstrapLogManager.getDefaultHandlersInternal(BootstrapLogManager.java:109)
>         at org.apache.karaf.main.util.BootstrapLogManager.getDefaultHandlers(BootstrapLogManager.java:70)
>         at org.apache.karaf.main.util.BootstrapLogManager.configureLogger(BootstrapLogManager.java:75)
>         at org.apache.karaf.main.lock.SimpleFileLock.<init>(SimpleFileLock.java:40)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
>         at org.apache.karaf.main.Main.createLock(Main.java:476)
>         at org.apache.karaf.main.Main.doMonitor(Main.java:378)
>         at org.apache.karaf.main.Main.access$100(Main.java:75)
>         at org.apache.karaf.main.Main$3.run(Main.java:369)
> {code}
> Looks like BootstrapLogManager attempts to use java.util.logging levels which DEBUG is
not one of them. This however does result in valid logging out via log4j2 to the console appender.

> Using a valid java.util.logger level (tried FINE during testing) results in logging to
the console from 'SimpleFileLock' but nothing from log4j2.



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

Mime
View raw message