
But then JUL would still print it's output to the default handler wouldn't it? handlers= java.util.logging.ConsoleHandler java.util.logging.ConsoleHandler.level = INFO java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter So I would have double log prints? cheers ----- Flavio Donzé Software Engineer My Blog: http://swissdev.blogspot.com/ -----Ursprüngliche Nachricht----- Von: logback-user-bounces@qos.ch [mailto:logback-user-bounces@qos.ch] Im Auftrag von Ceki Gulcu Gesendet: Mittwoch, 17. Juni 2009 15:22 An: logback users list Betreff: Re: [logback-user] Trouble with Logback / JUL configuration Thanks for the feedback and sharing your code. You can accomplish the same with less: java.util.logging.Logger logger = java.util.logging.Logger.getLogger(""); logger.setLevel(java.util.logging.Level.FINEST); HTH, Flavio Donzé wrote:
Hi Ceki
Thanks for your reply, here how I solved it:
URL logging = context.getBundle().getResource("logging.properties"); if (logging == null) { throw new IOException("logging.properties not found in com.softmodeler.osgi.over.slf4j"); } InputStream inputStream = logging.openStream(); LogManager.getLogManager().readConfiguration(inputStream);
SLF4JBridgeHandler.install();
The loaded logging.properties contains only one line: .level= FINEST Now I get all the messages over logback, JUL does not print anything.
Cheers flavio
----- Flavio Donzé Software Engineer My Blog: http://swissdev.blogspot.com/
-- Ceki Gülcü Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user