Is there a way to enable MySQL general query logging through JDBC? The closest thing I have found through my search is the ability to log slow queries through JDBC (http://d
I ended up finding a workaround. I enable MySQL general query logging through Java by modifying MySQL global system variables at runtime with the following SQL queries.
SET GLOBAL log_output="FILE"
SET GLOBAL general_log_file="Path/File"
SET GLOBAL general_log='ON'
I recommend using forward slashes in the general_log_file path. I could not get backslashes to work, even in a Windows environment.
I disable general query logging at runtime with the following SQL query.
SET GLOBAL general_log='OFF'