Run this at midnight and you will have all the slow queries in the slow_query.log file

NOW=$(date +"%Y-%m-%d")
LOGFILE="slow_query.$NOW.log"
$(touch /var/log/tomcat6/$LOGFILE)
## 800 msec is a maximum value for solr. Let's filter everything above that
$(cat /var/log/tomcat6/catalina.out | grep 'QTime' | awk -F 'QTime=' 'int($NF) >= 800' > /var/log/tomcat6/$LOGFILE)

This snippet will output your queries that have QTime’s above 800msec. Do have you better snippets? Please post them in the comments