Hi Chris,

I see what you're saying. My thought was that since both lines are logging
exactly the same message, it'd be redundant to log it twice. I can
definitely see logging it in both levels, but modifying the warn message to
have a "slow query:" prefix or something. What do you think?

Thanks,
Jessica

On Fri, Oct 24, 2014 at 10:58 AM, Chris Hostetter <[email protected]>
wrote:

>
> 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