diff --git a/doc/mysqlnd_azure_log.md b/doc/mysqlnd_azure_log.md index 37dd711..dc90f57 100644 --- a/doc/mysqlnd_azure_log.md +++ b/doc/mysqlnd_azure_log.md @@ -6,7 +6,7 @@ Log down some runtime information from mysqlnd\_azure. ### Log destination supported (mysqlnd\_azure.logOutput) -**Notice** +**Notice:** For all the file paths mentioned below, except Apache and php-fpm's system error log, it need to be configured with right user permission, e.g. www-data for Apache. For relative file path, when working in cli, the father path is the current working directoy, when working with Apache, the father path is /. We provide multiple options for log destination you may want to choose. @@ -22,17 +22,17 @@ Dynamic | No Value | Behavior | Sample log :----- | :------ | :----- -0 | Like logLevel control, it will turn off the log. No log will be print out | -1 | Print logs using PHP error log API.
PHP CLI: Print to console
Work scenario with Apache/Nginx: Will be discussed in seperated section below | Warning: mysqli_real_connect(): [2020-07-20 14:09:03] [MYSQLND_AZURE] [ERROR] CLIENT_SSL is not set when mysqlnd_azure.enableRedirect is ON in mysqli_basic.php on line 6 -2 | Print logs to a pre-defined file by mysqlnd\_azure's config mysqlnd\_azure.logfilePath=xx.log | [MYSQLND_AZURE] [ERROR] CLIENT_SSL is not set when mysqlnd_azure.enableRedirect is ON -4 | Print logs using stderr.
PHP CLI: Print to console
Work scenario with Apache/Nginx: Will be discussed in seperated section below | [MYSQLND_AZURE] [ERROR] CLIENT_SSL is not set when mysqlnd_azure.enableRedirect is ON +0 | Like logLevel control, it will turn off the log. No log will be print out. | +1 | Print logs using PHP error log API.
- PHP CLI: Print to console.
- Work scenario with Apache/Nginx: Will be discussed in seperated section below. | Warning: mysqli_real_connect(): [2020-07-20 14:09:03] [MYSQLND_AZURE] [ERROR] CLIENT_SSL is not set when mysqlnd_azure.enableRedirect is ON in mysqli_basic.php on line 6 +2 | Print logs to a pre-defined file by mysqlnd\_azure's config mysqlnd\_azure.logfilePath=xx.log. | [MYSQLND_AZURE] [ERROR] CLIENT_SSL is not set when mysqlnd_azure.enableRedirect is ON +4 | Print logs using stderr.
- PHP CLI: Print to console.
- Work scenario with Apache/Nginx: Will be discussed in seperated section below. | [MYSQLND_AZURE] [ERROR] CLIENT_SSL is not set when mysqlnd_azure.enableRedirect is ON #### Detailed behavior for logOutput1 and logOutput4 - **For mod-php and Apache (take php7.2 as example)** Config file | Config options | Usage :----- | :------ | :----- -/etc/php/7.2/apache2/php.ini | -error_log
-log_error
-display_errors | This file is Apache mod_php's config file s
-log_error: logOutput1 is only available if this is on.
error_log: where logOutput1 goes into.
--1. error_log=syslog: logOutput1 is not available with this option.
--2. error_log=A_file_path. It will take priority of apache’s error log setting.
display_errors: Whether print logOutput1 to a client web page. +/etc/php/7.2/apache2/php.ini | error_log
log_error
display_errors | This file is Apache mod_php's config file s
-log_error: logOutput1 is only available if this is on.
error_log: where logOutput1 goes into.
--1. error_log=syslog: logOutput1 is not available with this option.
--2. error_log=A_file_path. It will take priority of apache’s error log setting.
display_errors: Whether print logOutput1 to a client web page. /etc/apache2/sites-available/000-default.conf | ErrorLog | This file is Apache's error log path for seperated virtual instance.
If error_log is not set in php.ini above, logOutput1 will go here. /etc/apache2/apache2.conf | ErrorLog | This file is Apache’s global error log path.
logOutput4 goes here.
If ErrorLog is not set for each virtual host, and error_log is not set in php.ini, then logOutput4 also goes here. @@ -41,11 +41,12 @@ Config file | Config options | Usage Config file | Config options | Usage :----- | :------ | :----- /etc/php/7.2/fpm/php-fpm.conf | error_log | This Php-fpm’s system error log, has content like php-fpm is restarted or crashed.
-- logOutput4 will go here if catch_workers_output = yes in www.conf.
logOutput1 will also go here if catch_workers_output = yes in www.conf && log_errors=ON && error_log is not set in php.ini and www.conf below. -/etc/php/7.2/fpm/php.ini | - error_log
- log_error
- display_errors | - error_log: The destination logOutput1 goes to.
- log_error: same with mod_php.
- display_errors: same with mod_php. -/etc/php/7.2/fpm/pool.d/www.conf | - catch_workers_output
- php_admin_value[error_log]
- php_admin_flag[log_errors] - php_flag[display_errors] | - catch_workers_output:
Whether catch logOutput4 and logOutput1.
-- php_admin_value[error_log]:
-- php_admin_flag[log_errors]:
-- php_flag[display_errors]:
Same as that in php.ini, but the definitions here take priority. +/etc/php/7.2/fpm/php.ini | error_log
log_error
display_errors | - error_log: The destination logOutput1 goes to.
- log_error: same with mod_php.
- display_errors: same with mod_php. +/etc/php/7.2/fpm/pool.d/www.conf | catch_workers_output
php_admin_value[error_log]
php_admin_flag[log_errors]
php_flag[display_errors] | - catch_workers_output:
Whether catch logOutput4 and logOutput1.

-- php_admin_value[error_log]:
-- php_admin_flag[log_errors]:
-- php_flag[display_errors]:
Same as that in php.ini, but the definitions here take priority. /etc/apache2/sites-available/000-default.conf | ErrorLog | logOutput1 will go here if the error_log is not set in php.ini and www.conf.
Please notice that the logs for single request is in single line since fastcgi treat one request’s log as single line) /etc/apache2/apache2.conf | ErrorLog | Apache’s global error log path.
logOutput1 will go here if the error_log is not set in php.ini and www.conf and ErrorLog is not set in each virtual instance +Work scenario with Nginx is similar. ### mysqlnd\_azure.logfilePath @@ -56,7 +57,7 @@ Type | String Accepted Value | String length <= 255, legal filename string Default | mysqlnd\_azure\_runtime.log Dynamic | NO -Note | 1. This variable is not dynamic, only can set in php.ini, not possible by `ini_set('mysqlnd_azure.logLevel', '$VAL'); `
2. Filename length cannot exceed the file system's restriction(255), otherwise system will use the default filename and throw a warning "Given logfile name too long, redirected to default: mysqlnd_azure_runtime.log" +Note | Filename length cannot exceed the file system's restriction(255), otherwise system will use the default filename and throw a warning "Given logfile name too long, redirected to default: mysqlnd_azure_runtime.log" ### mysqlnd\_azure.logLevel Name | mysqlnd\_azure.logLevel @@ -66,6 +67,7 @@ Type | Enumeration Accepted Value | [ 0 \| 1 \| 2 \| 3 ] Default | 0 (OFF) Dynamic | Yes +Note | This variable is dynamic, you may use user srcipt API `ini_set('mysqlnd_azure.logLevel', '$VAL'); ` to check log with different verbose level. ### Loglevel supported we support 3 level of logs for user: