Vishal
Vishal

Reputation: 2752

How to enable wire logging in Jetty Server

We have a service which uses Jetty Server 7.6.0

I am trying to enable wire logging by putting following configuration

<!-- Configure an appender for the wire log-->
                <prop key="log4j.appender.WIRE">org.apache.log4j.DailyRollingFileAppender</prop>
                <prop key="log4j.appender.WIRE.Threshold">TRACE</prop>
                <prop key="log4j.appender.WIRE.File">${root}/var/output/logs/wire.log</prop>
                <prop key="log4j.appender.WIRE.DatePattern">&apos;.&apos;yyyy-MM-dd-HH</prop>
                <prop key="log4j.appender.WIRE.Append">true</prop>
                <prop key="log4j.appender.WIRE.Encoding">UTF8</prop>
                <prop key="log4j.appender.WIRE.layout">org.apache.log4j.PatternLayout</prop>
                <prop key="log4j.appender.WIRE.layout.ConversionPattern">%d{DATE} [%p] %X{RequestId} (%t) %c:%m%n</prop>

                <!-- Adjust log levels -->
                <prop key="log4j.logger.WIRE">TRACE, WIRE</prop>

When I start the server, wire.log file is getting created but it is not printing anything from my requests into the log file.

I wanted to know is wire logging something specific to Tomcat ? If no , any idea how to enable it in Jetty?

Thanks,

Vishal

Upvotes: 0

Views: 1562

Answers (1)

Cristian Sevescu
Cristian Sevescu

Reputation: 1489

Wire logging is an option for apache HttpClient.

Jetty is not using apache HttpClient, but org.eclipse.jetty.client.HttpClient (https://wiki.eclipse.org/Jetty/Tutorial/HttpClient).

Logging http messages in jetty has been discussed here.

This may also help you.

Upvotes: 2

Related Questions