: 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?
yeah -- it's definitely a trade off between redundency vs convinience -- but i'm +1 for being redundent in this case. the biggest worry i have: some existing Ops or DW team has a tier of Solr servers with log crunching all setup to get stats on queries, looking explicitly at the existing INFO messages -- and then some dev with the best intentions at heart comes along and adds this new config option so they can focus on problematic queries, w/o realizing how it will affect the existing monitoring -- and now the stats coming out of hte existing log monitoring are totally skewed. Anyone in a situation where the redundency would be unwelcome is probably either dealing with a high enough volume that INFO logging is disabled anyway, or a low evenough volume that they don't need this feature, they can check for "slow" queries themselves from the INFO level messages. : 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] : > : > : -Hoss http://www.lucidworks.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
