You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by R Smith <rs...@gmail.com> on 2010/06/11 01:01:49 UTC

Request log does not show QTime

How do you customize the RequestLog to include the query time, hits, and
other stats. Here is my configuration in jetty.xml, but the output does not
include any of this information, it looks like this

10.1.38.40 -  -  [10/06/2010:14:27:05 -0800] "POST /solr/select/ HTTP/1.1"
200 15010
10.1.38.40 -  -  [10/06/2010:14:27:05 -0800] "POST /solr/select/ HTTP/1.1"
200 13422
10.1.38.40 -  -  [10/06/2010:14:27:05 -0800] "POST /solr/select/ HTTP/1.1"
200 1659

jetty.xml:
    <Ref id="RequestLog">
      <Set name="requestLog">
        <New id="RequestLogImpl" class="org.mortbay.jetty.NCSARequestLog">
          <Arg><SystemProperty name="jetty.logs" default="logs/"
/>log.query.yyyy_mm_dd</Arg>
          <Set name="retainDays">90</Set>
          <Set name="append">true</Set>
          <Set name="extended">false</Set>
          <Set name="LogTimeZone">America/Los_Angeles</Set>
        </New>
      </Set>
    </Ref>

Note, I do see this information in log.solr.0, but it also includes the full
query parameters which are too verbose, so I need to turn that logging off.
Jun 10, 2010 1:35:03 PM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/solr path=/select/ params={...} hits=4587 status=0 QTime=19


I have read a lot of the documentation on Solr logging and SLF4J, but could
not figure it out from those.

Re: Request log does not show QTime

Posted by Lance Norskog <go...@gmail.com>.
Log4j has a nice template system for logging. You might be able to
make a logging rule that rips out the query string but prints the
rest.

On Thu, Jun 10, 2010 at 4:01 PM, R Smith <rs...@gmail.com> wrote:
> How do you customize the RequestLog to include the query time, hits, and
> other stats. Here is my configuration in jetty.xml, but the output does not
> include any of this information, it looks like this
>
> 10.1.38.40 -  -  [10/06/2010:14:27:05 -0800] "POST /solr/select/ HTTP/1.1"
> 200 15010
> 10.1.38.40 -  -  [10/06/2010:14:27:05 -0800] "POST /solr/select/ HTTP/1.1"
> 200 13422
> 10.1.38.40 -  -  [10/06/2010:14:27:05 -0800] "POST /solr/select/ HTTP/1.1"
> 200 1659
>
> jetty.xml:
>    <Ref id="RequestLog">
>      <Set name="requestLog">
>        <New id="RequestLogImpl" class="org.mortbay.jetty.NCSARequestLog">
>          <Arg><SystemProperty name="jetty.logs" default="logs/"
> />log.query.yyyy_mm_dd</Arg>
>          <Set name="retainDays">90</Set>
>          <Set name="append">true</Set>
>          <Set name="extended">false</Set>
>          <Set name="LogTimeZone">America/Los_Angeles</Set>
>        </New>
>      </Set>
>    </Ref>
>
> Note, I do see this information in log.solr.0, but it also includes the full
> query parameters which are too verbose, so I need to turn that logging off.
> Jun 10, 2010 1:35:03 PM org.apache.solr.core.SolrCore execute
> INFO: [] webapp=/solr path=/select/ params={...} hits=4587 status=0 QTime=19
>
>
> I have read a lot of the documentation on Solr logging and SLF4J, but could
> not figure it out from those.
>



-- 
Lance Norskog
goksron@gmail.com

Re: Request log does not show QTime

Posted by Chris Hostetter <ho...@fucit.org>.
: How do you customize the RequestLog to include the query time, hits, and

the "RequestLog" is a jetty specific log file -- it's only going to know 
the concepts that Jetty specificly knows about.

: Note, I do see this information in log.solr.0, but it also includes the full
: query parameters which are too verbose, so I need to turn that logging off.
: Jun 10, 2010 1:35:03 PM org.apache.solr.core.SolrCore execute
: INFO: [] webapp=/solr path=/select/ params={...} hits=4587 status=0 QTime=19

that's the format Solr uses for logging individual requests.  if you 
want to change it you can either write a custom LogHandler or a custom 
LogFormatter, or you can post-process...

http://java.sun.com/j2se/1.5.0/docs/guide/logging/overview.html



-Hoss