url : http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html
under 5.7.2 : log_warnings
over 5.7.2 : log_error_verbosity
Deprecated | 5.7.2 | ||
Command-Line Format | --log-warnings[=#] |
||
System Variable | Name | log_warnings |
|
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values (32-bit platforms, <= 5.7.1) | Type | integer |
|
Default | 1 |
||
Min Value | 0 |
||
Max Value | 4294967295 |
||
Permitted Values (32-bit platforms, >= 5.7.2) | Type | integer |
|
Default | 2 |
||
Min Value | 0 |
||
Max Value | 4294967295 |
||
Permitted Values (64-bit platforms, <= 5.7.1) | Type | integer |
|
Default | 1 |
||
Min Value | 0 |
||
Max Value | 18446744073709551615 |
||
Permitted Values (64-bit platforms, >= 5.7.2) | Type | integer |
|
Default | 2 |
||
Min Value | 0 |
||
Max Value | 18446744073709551615 |
Whether to produce additional warning messages to the error log. This variable 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. The server logs messages about statements that are unsafe for statement-based logging if the value is greater than 0. Aborted connections and access-denied errors for new connection attempts are logged if the value is greater than 1. See Section B.5.2.11, “Communication Errors and Aborted Connections”.
Enabling this option by setting it greater than 0 is recommended, if you use replication, to get more information about what is happening, such as messages about network failures and reconnections. If the value is greater than 1, aborted connections are written to the error log, and access-denied errors for new connection attempts are written.
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.
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.)
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.
Introduced | 5.7.2 | ||
Command-Line Format | --log_error_verbosity=# |
||
System Variable | Name | log_error_verbosity |
|
Variable Scope | Global | ||
Dynamic Variable | Yes | ||
Permitted Values | Type | integer |
|
Default | 3 |
||
Min Value | 1 |
||
Max Value | 3 |
This variable controls verbosity of the server in writing error, warning, and note messages to the error log. The following table shows the permitted values. The default is 3.
Verbosity Value | Message Types Logged |
---|---|
1 | Errors only |
2 | Errors and warnings |
3 | Errors, warnings, and notes |
log_error_verbosity
was added in MySQL 5.7.2. It is preferred over, and should be used instead of, the older log_warnings
system variable. See the description oflog_warnings
for information about how that variable relates to log_error_verbosity
. In particular, assigning a value to log_warnings
assigns a value tolog_error_verbosity
and vice versa.