Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] How to enable jetty version 6.1.6 logs (Jetty jar is part of my application)

Am 29.10.2013 12:52, schrieb nagarjuna surabhatina:
> We are using the jetty 6.1.6 jar in our application for registering
> and un-registering listening descriptors. My application is designed
> based on java.util.logging.. How to enable jetty logs in my application

You can call
org.eclipse.jetty.util.log.Log.setLog(Logger) allows you to set
the Logger to be used in a programmatically way. E.g. you can call
Log.setLog(new JavaUtilLog());
and do the concrete configuration according to the way it is done
in the Java-Logging-Framework.

With Jetty 7.6 or higher you need to do this call before any
other Jetty-specific class, especially org.eclipse.jetty.server.Server
is loaded. The static initialization (which happens at the point
where you declare a member in your class) of Server consists
of the setting of the Logger to be used, so if you set your Logger
afterwards, it will have no effect on logs being generated by Server
and will end on STDOUT.


Regards, Lothar


Back to the top