Solr is great, but I'm always surprised the stats component doesn't have any info on slow queries. I _could_ add this info to Solr, but that would require everyone who wanted this data to include a separate class and handle the reporting themselves. It also wouldn't immediately address the needs of a distributed environment.

Instead, I wrote Slowlr, which consists of two parts: a log reader script and an app that reports on the stored logs. The reader script, you pipe your log file into, and it parses the logs and writes it into Solr. The Flask application reads values from Mongo, presenting values ordered by average query time, descending. Clicking on a query will give you more statistics about individual log instances.

I like to set a time-to-live on query documents to an hour. This means that persistent slow queries are more likely to be reported on, and ephemeral slow queries will be less represented.

Also, slow lorises.