我正在使用netty和resteasy来实现REST接口。我在日志文件中获取这些条目:
2016-09-14 13:29:31.116 DEBUG i18n getInvoker() - RESTEASY002315: PathInfo: /director/logmessage
2016-09-14 13:29:31.126 DEBUG i18n getInvoker() - RESTEASY002315: PathInfo: /director/sendresult
2016-09-14 13:29:31.154 DEBUG i18n getInvoker() - RESTEASY002315: PathInfo: /director/logmessage
2016-09-14 13:29:31.161 DEBUG i18n getInvoker() - RESTEASY002315: PathInfo: /director/logmessage
包i18n似乎在本机java发行版中:com.sun.imageio.plugins
,我试图按如下方式更改log4 jlevels:
<appender name="netty" class="org.apache.log4j.FileAppender">
<param name="append" value="true" />
<param name="file" value="atf_logs/atf_http.log" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p %c{1} %M() - %m%n" />
</layout>
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="LevelMin" value="ERROR" />
<param name="LevelMax" value="FATAL" />
</filter>
</appender>
<logger name="com.sun.imageio.plugins" additivity="false">
<level value="INFO" />
<appender-ref ref="netty" />
</logger>
我也尝试过:
<logger name="org.jboss.resteasy.client.jaxrs.i18n" additivity="false">
<level value="INFO" />
<appender-ref ref="netty" />
</logger>
任何想法都赞赏。
答案 0 :(得分:2)
您可以尝试调整log4j的以下内容:
<logger name="org.jboss.resteasy.core" level="INFO" />
<logger name="org.jboss.resteasy.specimpl" level="INFO" />
<logger name="org.jboss.resteasy.plugins.server" level="INFO" />