Error Log

suggest change

The Error Log is populated with start and stop information, and critical events encountered by the server.

The following is an example of its contents:

The variable log_error holds the path to the log file for error logging.

With no log_error setting, the log is hostname.err in the data directory. log_error is not dynamic. Change it in a cnf or ini file and restart the server (or follow “Flushing and Renaming the Error Log File” in the manual).

Logging cannot be disabled for errors. They are important for system health while troubleshooting problems. Also, entries are infrequent compared to the General Query Log.

The GLOBAL variable log_warnings sets the level for verbosity which varies by server version. The following snippet illustrates:

SELECT @@log_warnings; -- make a note of your prior setting
SET GLOBAL log_warnings=2; -- setting above 1 increases output (see server version)

log_warnings as seen above is dynamic. MySQL 8.0 removed it. Use log_error_verbosity there.

Configuration file changes in cnf and ini files might look like the following.

[mysqld]
log_error        = /path/to/CurrentError.log
log_warnings     = 2

MySQL 5.7.2 expanded the warning level verbosity to 3 and added the GLOBAL log_error_verbosity. Again, it was introduced in 5.7.2. It can be set dynamically and checked as a variable or set via cnf or ini configuration file settings.

As of MySQL 5.7.2:

[mysqld]
log_error           = /path/to/CurrentError.log
log_warnings        = 2
log_error_verbosity = 3

See The Error Log, especially flushing and renaming the file, and the verbosity section for log_warnings and log_error_verbosity.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents