简体   繁体   English

Apache Solr 客户端 = 如何启用“有线”日志记录(使用 log4j)

[英]Apache Solr Client = How to enable “wire” logging (with log4j)

I would be very thankfull, if someone can tell me, how to enable "wire logging" (printing all the XML that is sent and received from the solr-java-client to/from the solr-server).如果有人能告诉我,我将非常感谢,如何启用“有线记录”(打印从 solr-java-client 到/从 solr-server 发送和接收的所有 XML)。

The Client i use: http://wiki.apache.org/solr/SolJava I use log4j!!我使用的客户端: http://wiki.apache.org/solr/SolJava我使用 log4j!

Both did NOT work in log4j config:两者都在 log4j 配置中不起作用:

<logger name="org.apache.solr" additivity="false">     
    <level value="debug" />
    <appender-ref ref="RollingFileAppender" />
    <appender-ref ref="ConsoleAppender" />  
  </logger>


<logger name="org.apache.commons.httpclient" additivity="false">     
    <level value="debug" /> 
    <appender-ref ref="RollingFileAppender" />
    <appender-ref ref="ConsoleAppender" />  
  </logger>

Solr internally uses another logging framework slf??? Solr内部使用另一个日志框架slf??? ,maybe this is the reason, but I do not know where to start here how to solve the problem. ,也许这就是原因,但我不知道从哪里开始如何解决问题。

Thanks!!!谢谢!!! Jens延斯

Solr makes use of the JDK Logging since Version 1.4 . Solr 从1.4 版开始使用JDK 日志记录

Maybe this tutorial will help you figure out how to configure your Tomcat for that.也许本教程将帮助您了解如何为此配置 Tomcat。

Or replace the slfj api within the solr.war file with the one for log4j as mentioned in the Solr documentation.或者将 solr.war 文件中的slfj api 替换为 log4j 文件中提到的 log4j。

If you want to have more information within the client look at the SolrQuery javadoc.如果您想在客户端中获得更多信息,请查看SolrQuery javadoc。

Hope this helps you a step forward.希望这可以帮助您向前迈出一步。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM