How to configure java.util.logging to work in karaf

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to configure java.util.logging to work in karaf

DataFarmer
Hi all,

on http://karaf.apache.org/manual/2.2.6/users-guide/logging-system.html it says that karaf supports a number of logging APIs:

In addition to being a standard OSGi Log service, it supports the following APIs:

•Apache Commons Logging
•SLF4J
•Apache Log4j
•Java Util Logging
However, I don't have a clue how to configure my java.util Loggers using the (all log4j-based) logging config at

[karaf_install_dir]/etc/org.ops4j.pax.logging.cfg

Can anyone enlighten me? I have tried to simply add java.util.logging config entries into the above-mentioned file like

handlers = java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level = ALL
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
my.package.level = ALL
but without success. (i.e. these entries seem to be ignored and still everything is logged with the INFO level configured for the root logger)

What I want to achieve is to have everything logged at INFO level (and above) and to only have my.package (and subpackages) logged with maximum verbosity.

Thanks for any help or examples