9
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Solr でレスポンスタイムをログに出力する

Posted at

logLatencyを設定すると、ログ行の最後にミリ秒単位でレスポンスタイムが記録されるようになる。

etc/jetty.xml
<!-- =========================================================== -->
<!-- Configure Request Log                                       -->
<!-- =========================================================== -->
<Ref id="Handlers">
  <Call name="addHandler">
    <Arg>
      <New id="RequestLog" class="org.eclipse.jetty.server.handler.RequestLogHandler">
        <Set name="requestLog">
          <New id="RequestLogImpl" class="org.eclipse.jetty.server.NCSARequestLog">
            <Set name="filename">
               logs/request.yyyy_mm_dd.log
            </Set>
            <Set name="filenameDateFormat">yyyy_mm_dd</Set>
            <Set name="retainDays">90</Set>
            <Set name="append">true</Set>
            <Set name="extended">false</Set>
            <Set name="logCookies">false</Set>
            <Set name="LogTimeZone">UTC</Set>
            <Set name="LogLatency">true</Set>
          </New>
        </Set>
      </New>
    </Arg>
  </Call>
</Ref>
request.log
127.0.0.1 -  -  [13/11/2012:01:37:24 +0000] "GET /solr/admin/cores?wt=json HTTP/1.1" 200 942  2
127.0.0.1 -  -  [13/11/2012:01:37:24 +0000] "GET /solr/collection1/admin/system?wt=json HTTP/1.1" 200 3226  32
127.0.0.1 -  -  [13/11/2012:01:37:35 +0000] "GET /solr/collection1/admin/logging?wt=json&since=0 HTTP/1.1" 200 7689  4
127.0.0.1 -  -  [13/11/2012:01:37:45 +0000] "GET /solr/collection1/admin/logging?wt=json&since=1352770631285 HTTP/1.1" 200 282  1
127.0.0.1 -  -  [13/11/2012:01:37:55 +0000] "GET /solr/collection1/admin/logging?wt=json&since=1352770631285 HTTP/1.1" 200 282  1
9
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?