lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Wolanin (JIRA)" <>
Subject [jira] [Commented] (SOLR-232) let Solr set request headers (for logging)
Date Sun, 24 Apr 2011 16:29:05 GMT


Peter Wolanin commented on SOLR-232:

Looks like the title needs to change?  From looking at the Solr 1.4 code, it seems this issue
is now about setting RESPONSE headers?

That's certainly the use case I have in mind, and what seems to be commented out in the Solr
1.4 code:

              // add info to http headers
              //TODO: See SOLR-232 and SOLR-267.  
                /*try {
                  NamedList solrRspHeader = solrRsp.getResponseHeader();
                 for (int i=0; i<solrRspHeader.size(); i++) {
                   ((javax.servlet.http.HttpServletResponse) response).addHeader(("Solr-"
+ solrRspHeader.getName(i)), String.valueOf(solrRspHeader.getVal(i)));
                } catch (ClassCastException cce) {
                  log.log(Level.WARNING, "exception adding response header log information",

However, the things currently sent in the response header seem to be missing the # of matches
(logged as "hits"), and I'm not sure I'd want all the params sent back as headers by default.

So, maybe we need a method like solrRsp.getHttpResponseHeader(); instead of using solrRsp.getResponseHeader();
 and corresponding setters?

> let Solr set request headers (for logging)
> ------------------------------------------
>                 Key: SOLR-232
>                 URL:
>             Project: Solr
>          Issue Type: New Feature
>         Environment: tomcat?
>            Reporter: Ian Holsman
>            Priority: Minor
>         Attachments: meta.patch
> I need the ability to log certain information about a request so that I can feed it into
performance and capacity monitoring systems.
> I would like to know things like
> - how long the request took 
> - how many rows were fetched and returned
> - what handler was called.
> per request.
> the following patch is 1 way to implement this, I'm sure there are better ways.

This message is automatically generated by JIRA.
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message