Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Configuration jetty server logging.

Thanks Joakim,

That worked. However adding this line

org.eclipse.jetty.LEVEL=DEBUG

to jetty-logging.properties or to log4j.properties doesn't make jetty to log DEBUG messages. 
If I change rootLogger to DEBUG, debug logging works for my application and for jetty.

How can I change log level only for jetty?

BTW, to answer your question, I have placed jetty-logging.properties and log4j.properties in a config dir and added config dir to classpath.

Thanks,
Raja.


On Tue, Nov 5, 2013 at 12:09 PM, Joakim Erdfelt <joakim@xxxxxxxxxxx> wrote:
You say you have these 2 in your classpath.

jetty-logging.properties
log4j.properties

Can you be more specific?
What directory?

Alternatively, as you mentioned you are using Jetty Embedded, you can simply call this, before you initialize anything else in jetty.

import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Slf4jLog;

    Log.setLog(new Slf4jLog());

That does the same thing as what jetty-logging.properties is doing.

--
Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts


On Tue, Nov 5, 2013 at 9:40 AM, Rajasekar Elango <relango@xxxxxxxxxxxxxx> wrote:
We would like to make jetty use log4j configuration for logging. I am using embedded jetty within spring based on this tutorial. I am followed this documentation to include all required slf4j and log4j dependencies in classpath. 

Basically I added jetty-logging.properties to classpath with following configuration.

org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.Slf4Log
org.eclipse.jetty.LEVEL=INFO

I also have log4j.properties in classpath

I have following maven dependencies to include required jars.

                <dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.log4j.version}</version>
</dependency>

                <dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jetty.maven.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>8.1.9.v20130131</version>
</dependency>


But when I start up the jetty server via spring, the log output is always logged to StdErr and it's not logging to log file I configured in log4j.properties. Am  I missing anything? Is there any debugging I can turn on to troubleshoot ..? How can I get this to work?

--
Thanks,
Raja.

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users



_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users




--
Thanks,
Raja.

Back to the top