Menu

Getting Started

kevin cowan
  • Download the latest SolrLog4J jar file, and it's dependencies.
  • Add these jars to your web applications classpath.
  • Open your log4j configuration file:

For Log4J 1.x:

  # Set root logger level to DEBUG and its only appender to solrlog4j.

log4j.rootLogger=ALL, solrlog4j

solrlog4j is set to be a ConsoleAppender.

log4j.appender.solrlog4j=com.cprassoc.solr.logging.SolrAppender

For Log4j 2.x:

Add this line to your "Loggers" element in Log4j2.xml:

<Logger name="com.cprassoc.solr.logging.SolrLogger" level="all"/>

Restart your web application, and you should see logging happening like so:

Logging Message: Sending request: POST /solr/solrlog4j/update/json?wt=json&commit=true HTTP/1.1
Add to queue...0
Processing Log...
MESSAGE: Sending request: POST /solr/solrlog4j/update/json?wt=json&commit=true HTTP/1.1
Send Debug Message
Send Message...>> "POST /solr/solrlog4j/update/json?wt=json&commit=true HTTP/1.1[\r][\n]"
Logging Message: >> "POST /solr/solrlog4j/update/json?wt=json&commit=true HTTP/1.1[\r][\n]"
Add to queue...0
MESSAGE: >> "POST /solr/solrlog4j/update/json?wt=json&commit=true HTTP/1.1[\r][\n]"`

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.