mysqldumpslow — Summarize Slow Query Log Files
SHOW VARIABLES LIKE '%log%';
SET GLOBAL slow_query_log = 'ON';
[mysqld]
# Set Slow Query Log
long_query_time = 1
slow_query_log = 1
slow_query_log_file = /usr/log/slowquery.log
log_queries_not_using_indexes = 1
#Set General Log
general_log = on
general_log_file=/usr/log/general.log
Note that enabling general_log on a production server has overhead you should avoid it. You can check problematic queries from slow log.