【发布时间】:2016-07-05 09:02:17
【问题描述】:
我使用 Jersey-1.19、Jackson-1.9.2、log4j-1.2、Java 和 Servlet 技术创建了一个项目 WS REST。为了运行我使用 tomcat-8 的项目。
我需要配置文件 log4j.properties 来向我展示所有对 WS REST 中可用的方法的所有请求。有可能吗?
基本上,我需要为记录所有请求做什么?
我的 log4j.properties 是:
#### Use two appenders, one to log to console, another to log to a file
logFolder = D:/logs
log4j.rootCategory=debug
#### First appender writes to console
log4j.appender.myConsole=org.apache.log4j.ConsoleAppender
log4j.appender.myConsole.Threshold=debug
log4j.appender.myConsole.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
log4j.appender.myConsole.layout.ConversionPattern=%d{DATE} %-5p: [%C{1}.%M(%L)] %m%n
【问题讨论】: