Index: src/java/org/apache/solr/core/SolrCore.java =================================================================== --- src/java/org/apache/solr/core/SolrCore.java (revision 549454) +++ src/java/org/apache/solr/core/SolrCore.java (working copy) @@ -52,6 +52,7 @@ import org.apache.solr.request.XMLResponseWriter; import org.apache.solr.schema.IndexSchema; import org.apache.solr.search.SolrIndexSearcher; +import org.apache.solr.search.DocList; import org.apache.solr.update.DirectUpdateHandler; import org.apache.solr.update.SolrIndexConfig; import org.apache.solr.update.SolrIndexWriter; @@ -659,9 +660,17 @@ handler.handleRequest(req,rsp); setResponseHeaderValues(handler,responseHeader,req,rsp); - log.info(req.getContext().get("path") + " " - + req.getParamString()+ " 0 "+ - (int)(rsp.getEndTime() - req.getStartTime())); + String resultLog = " -"; + if (rsp.getValues().size()>1 && rsp.getValues().getVal(1) instanceof DocList) { + int hits = ((DocList) rsp.getValues().getVal(1)).size(); + resultLog = " hits=" + hits; + } + log.info(req.getContext().get("webapp") + " " + + req.getContext().get("path") + " " + + req.getParamString() + + resultLog + + " 0 " + + (int)(rsp.getEndTime() - req.getStartTime())); } @Deprecated Index: src/webapp/src/org/apache/solr/servlet/SolrDispatchFilter.java =================================================================== --- src/webapp/src/org/apache/solr/servlet/SolrDispatchFilter.java (revision 549454) +++ src/webapp/src/org/apache/solr/servlet/SolrDispatchFilter.java (working copy) @@ -190,6 +190,8 @@ protected void execute( HttpServletRequest req, SolrRequestHandler handler, SolrQueryRequest sreq, SolrQueryResponse rsp) { // a custom filter could add more stuff to the request before passing it on. // for example: sreq.getContext().put( "HttpServletRequest", req ); + // this is used for logging the path in query stats + sreq.getContext().put( "webapp", req.getContextPath() ); core.execute( handler, sreq, rsp ); }