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.

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



Back to the top