Property | Value |
---|---|
Command-Line Format | --log-warnings[=#] |
Deprecated | 5.7.2 |
System Variable | log_warnings |
Scope | Global |
Dynamic | Yes |
Type | Integer |
Default Value (64-bit platforms, >= 5.7.2) | 2 |
Default Value (64-bit platforms, <= 5.7.1) | 1 |
Default Value (32-bit platforms, >= 5.7.2) | 2 |
Default Value (32-bit platforms, <= 5.7.1) | 1 |
Minimum Value | 0 |
Maximum Value (64-bit platforms) | 18446744073709551615 |
Maximum Value (32-bit platforms) | 4294967295 |
Whether to produce additional warning messages to the error log. As of MySQL 5.7.2, information items previously governed by log_warnings
are governed by log_error_verbosity
, which is preferred over, and should be used instead of, the older log_warnings
system variable. (The log_warnings
system variable and --log-warnings
command-line option are deprecated and will be removed in a future MySQL release.)
log_warnings
is enabled by default (the default is 1 before MySQL 5.7.2, 2 as of 5.7.2). To disable it, set it to 0. If the value is greater than 0, the server logs messages about statements that are unsafe for statement-based logging. If the value is greater than 1, the server logs aborted connections and access-denied errors for new connection attempts. See Section B.6.2.10, “Communication Errors and Aborted Connections”.
If you use replication, enabling this variable by setting it greater than 0 is recommended, to get more information about what is happening, such as messages about network failures and reconnections.
If a slave server is started with log_warnings
enabled, the slave prints messages to the error log to provide information about its status, such as the binary log and relay log coordinates where it starts its job, when it is switching to another relay log, when it reconnects after a disconnect, and so forth.
Assigning a value to log_warnings
assigns a value to log_error_verbosity
and vice versa. The variables are related as follows:
Suppression of all
log_warnings
items, achieved withlog_warnings=0
, is achieved withlog_error_verbosity=1
(errors only).Items printed for
log_warnings=1
or higher count as warnings and are printed forlog_error_verbosity=2
or higher.Items printed for
log_warnings=2
count as notes and are printed forlog_error_verbosity=3
.
As of MySQL 5.7.2, the default log level is controlled by log_error_verbosity
, which has a default of 3. In addition, the default for log_warnings
changes from 1 to 2, which corresponds to log_error_verbosity=3
. To achieve a logging level similar to the previous default, set log_error_verbosity=2
.
In MySQL 5.7.2 and higher, use of log_warnings
is still permitted but maps onto use of log_error_verbosity
as follows:
Setting
log_warnings=0
is equivalent tolog_error_verbosity=1
(errors only).Setting
log_warnings=1
is equivalent tolog_error_verbosity=2
(errors, warnings).Setting
log_warnings=2
(or higher) is equivalent tolog_error_verbosity=3
(errors, warnings, notes), and the server setslog_warnings
to 2 if a larger value is specified.