In order to debug a webapp and mysql queries, I've enabled the mysql query log. However it's not a very good format to tail and grep through. Ideally I'd like to be able to only show queries from a certain user, or queries to a certain database. If the mysql query log printed the database or user on each line, then I could grep it. Sometimes I want to see what happened at a certain date, but since mysql query log doesn't print the datetime on each line, then this is harder.
Is there some way to make the mysql query log be nicer to tail/grep/etc through?