想要删除调试级别日志(log4j)

时间:2016-01-09 14:32:29

标签: java log4j

我是log4j的新手。我被困在log4j日志级别。我的情况是我已经创建了web服务器,我打印了soap请求和响应。虽然我在跟踪级别获得了soap ui请求和响应,但是我的问题是,我想删除所有调试级别日志,但我的请求打印在跟踪级别,高于调试级别。如果我采取rootLogger=trace,那么我只看到soap请求和响应和调试级别日志。但如果我使用其他级别作为rootLogger,那么我无法看到跟踪级别日志。我想删除调试级别日志并保留跟踪级别..

我的Log4j.properties:

log4j.rootCategory=Trace, stdout
log4j.logger.org.springframework.ws.server.MessageTracing.sent=TRACE
log4j.logger.org.springframework.ws.server.MessageTracing.received=TRACE
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%p [%c{3}] %m%n



LOGS :
DEBUG [javaguys.webservices.UserServiceEndpoints] dafa

DEBUG [method.jaxb.XmlRootElementPayloadMethodProcessor] Marshalling [com.javaguys.webservices.getuserservices.GetUserResponse@39178c5c] to response payload

DEBUG [endpoint.interceptor.PayloadLoggingInterceptor] Response: <ns3:GetUserResponse xmlns:ns3="http://com/javaguys/webservices/getUserServices" xmlns:ns2="http://user.javaguys.blog.com"><ns3:userDetails><ns2:UserId>1</ns2:UserId><ns2:UserName>ashish</ns2:UserName><ns2:UserGender>M</ns2:UserGender><ns2:UserStatus>True</ns2:UserStatus></ns3:userDetails></ns3:GetUserResponse>

DEBUG [endpoint.interceptor.PayloadValidatingInterceptor] Response message validated
TRACE [server.MessageTracing.sent] Sent response [<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><ns3:GetUserResponse xmlns:ns2="http://user.javaguys.blog.com" xmlns:ns3="http://com/javaguys/webservices/getUserServices"><ns3:userDetails><ns2:UserId>1</ns2:UserId><ns2:UserName>ashish</ns2:UserName><ns2:UserGender>M</ns2:UserGender><ns2:UserStatus>True</ns2:UserStatus></ns3:userDetails></ns3:GetUserResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>] for request [<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:get="http://com/javaguys/webservices/getUserServices">
   <soapenv:Header/>
   <soapenv:Body>
      <get:GetUserRequest>
         <get:userId>1</get:userId>
      </get:GetUserRequest>
   </soapenv:Body>
</soapenv:Envelope>]

DEBUG [transport.http.MessageDispatcherServlet] Successfully completed request

有没有办法删除调试级别日志?

0 个答案:

没有答案