Several system variables are associated with log tables and files and enable runtime control over logging:
- The global log_output system variable indicates the current logging destination. It can be modified at runtime to change the destination.
- The global general_log and slow_query_log variables indicate whether the general query log and slow query log are enabled (ON) or disabled (OFF). You can set these variables at runtime to control whether the logs are enabled.
*The global general_log_file and slow_query_log_file variables indicate the names of the general query log and slow query log files. As of MySQL 5.1.29, you can set these variables at server startup or at runtime to change the names of the log files. Before MySQL 5.1.29, you can set these variables only at runtime, but the --log and --log-slow-queries options can be given with a file name argument at startup to change the log file names from their default values.
- The session sql_log_off variable can be set to ON or OFF to disable or enable general query logging for the current connection.