Does it really make sense for this to be an if/else situation?

it seems like the INFO logging should be completley independent from the 
WANR logging, so people could have INFO level logs of all the requests in 
one place, and WARN level logs of slow queries go to a distinct file for 
higher profile analysis.  AS things stand right now, you have to merge the 
logs if you wnat stats on all requests (ie: to compute percentiles of 
response time, or what the most requested fq params are, etc..)

: +      if (log.isInfoEnabled()) {
: +        log.info(rsp.getToLogAsString(logid));
: +      } else if (log.isWarnEnabled()) {
: +        final int qtime = (int)(rsp.getEndTime() - req.getStartTime());
: +        if (qtime >= slowQueryThresholdMillis) {
: +          log.warn(rsp.getToLogAsString(logid));


:      if (log.isInfoEnabled()) {
: -      StringBuilder sb = new 
StringBuilder(rsp.getToLogAsString(req.getCore().getLogId()));
: +      log.info(getLogStringAndClearRspToLog());
: +    } else if (log.isWarnEnabled()) {
: +      long elapsed = rsp.getEndTime() - req.getStartTime();
: +      if (elapsed >= slowUpdateThresholdMillis) {
: +        log.warn(getLogStringAndClearRspToLog());
: +      }



-Hoss
http://www.lucidworks.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to