This patch is added for print some running information of mysqlnd_azure to a local file.
Current status: Under developing.
New Added Configuration
mysqlnd_azure.logfilePath
Name
mysqlnd_azure.logfilePath
Comment
Filename that you want your log writes to.
Type
String
Accepted Value
String length <= 255, legal filename string
Default
mysqlnd_azure_runtime.log
Dynamic
NO
Note
1. This variable was inited at PHP Module Init (MINIT) period, and immutable at runtime. a call of ini_set('mysqlnd_azure.logLevel', '$VAL'); would fail. 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"
mysqlnd_azure.logLevel
Name
mysqlnd_azure.logLevel
Comment
The verbose level of log we generate.
Type
Enumeration
Accepted Value
[ 0 | 1 | 2 | 3 ]
Default
0 (OFF)
Dynamic
Yes
Note
1. When the current mysqlnd_azure.logLevel > 0, change logLevel at runtime will be logged.
Loglevel supported
we support 3 level of logs for user:
[DEBUG]:
source code path(inside which function);
connection information(except password);
verbose running status (e.g. customer given redirected server information directly... )
[INFO]:
connection fallback when mysqlnd_azure.enableRedirection=preferred with details (cannot get redirection
info from OK packet/ try connect using redirect information failed , ...);
cache operations
[ERROR]:
any operation may cause customer see connection break (e.x. original conn/ redirected_conn
established failed, ... and connection fall back when mysqlnd_azure.enableRedirection = ON)
[SYSTM] maked log rows for Azure mysqlnd Log Module itself, when current
mysqlnd_azure.logLevel > 0, any operation related to log system itself will be logged.
For example, if someone call ini_set('mysqlnd_azure.logLevel', '2'); at runtime, there
may appear a log like
After turned on the option mentioned before, you will see something like :
2020-03-13 11:00:13 [ERROR] Connection cannot established with given information, please check the server availability, or your parameters given
2020-03-13 11:00:54 [DEBUG] mysqlnd_azure.c: mysqlnd_azure::connect()
2020-03-13 11:00:54 [DEBUG] mysqlnd_azure.enableRedirect: PREFERRD
2020-03-13 11:00:54 [INFO ] SSL not enabled, and mysqlnd_zaure.enableRedirect if PREFERRED, connection will go through gateway.
2020-03-13 11:00:54 [DEBUG] mysqlnd_azure.c: mysqlnd_azure::connect()
2020-03-13 11:00:54 [INFO ] No cache found
2020-03-13 11:00:54 [DBEUG] mysqlnd_azure.c: mysqlnd_azure_data::connect()
2020-03-13 11:00:54 [DEBUG] Connection Information: host=127.0.0.1 user=santo db=test port=3306 flags=131072 persistent=1 state=0
2020-03-13 11:00:54 [ERROR] Connection cannot established with given information, please check the server availability, or your parameters given
2020-03-13 11:00:54 [DEBUG] mysqlnd_azure.c: mysqlnd_azure::connect()
2020-03-13 11:00:54 [INFO ] No cache found
2020-03-13 11:00:54 [DBEUG] mysqlnd_azure.c: mysqlnd_azure_data::connect()
2020-03-13 11:00:54 [DEBUG] Connection Information: host=santo.mysql.database.azure.com user=test@santo db= port=3306 flags=131072 persistent=1 state=0
2020-03-13 11:00:54 [DEBUG] Classical connection OK, try to get REDIRECTION information
2020-03-13 11:00:54 [DEBUG] mysqlnd_azure.c: get_redirect_info()
2020-03-13 11:00:54 [DEBUG] Successfully get redirection information, try to connect with redirection connection
2020-03-13 11:00:54 [DEBUG] mysqlnd_azure.c: set_redirect_client_options()
2020-03-13 11:00:55 [DEBUG] Redirect conntion established.
2020-03-13 11:00:55 [DEBUG] Prepare the context of new connection
2020-03-13 11:00:55 [DEBUG] mysqlnd_azure.c: mysqlnd_azure::connect()
2020-03-13 11:00:55 [DEBUG] mysqlnd_azure.enableRedirect: PREFERRD
2020-03-13 11:00:55 [INFO ] SSL not enabled, and mysqlnd_zaure.enableRedirect if PREFERRED, connection will go through gateway.
Logs for mysqlnd_azure plugin
This patch is added for print some running information of mysqlnd_azure to a local file. Current status: Under developing.
New Added Configuration
mysqlnd_azure.logfilePath
ini_set('mysqlnd_azure.logLevel', '$VAL');
would fail.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"
mysqlnd_azure.logLevel
mysqlnd_azure.logLevel > 0
, change logLevel at runtime will be logged.Loglevel supported
we support 3 level of logs for user:
Level value relationship to level logged
Configuration Example:
phpinfo() / php -i
After successfully configured, try
php -i
, there will be var:val pairs listed below mysqlnd_azure section, like:What the logs would be (example)
After turned on the option mentioned before, you will see something like :