MXS-1652 Add possibility to log SQL statements
With the flag --debug=enable-statement-logging it is now possible to instruct MaxScale to log all SQL statements it sends to the servers. The format of the logged string looks like: notice : SQL(127.0.0.1): 0, "SELECT ..." First the fixed string "SQL", followed by the server address in parenthesis followed by the actual return value of mysql_query(), followed by the statement itself. The "SQL" string makes the lines easy to grep for and having the return value before the statement makes it easier to spot since the length of the return value string does not wary much, but the length of the statements do wary a lot.
This commit is contained in:
@ -124,4 +124,19 @@ mxs_mysql_name_kind_t mxs_mysql_name_to_pcre(char *pcre,
|
||||
*/
|
||||
void mxs_mysql_set_server_version(MYSQL* mysql, SERVER* server);
|
||||
|
||||
/**
|
||||
* Enable/disable the logging of all SQL statements MaxScale sends to
|
||||
* the servers.
|
||||
*
|
||||
* @param enable If true, enable, if false, disable.
|
||||
*/
|
||||
void mxs_mysql_set_log_statements(bool enable);
|
||||
|
||||
/**
|
||||
* Returns whether SQL statements sent to the servers are logged or not.
|
||||
*
|
||||
* @return True, if statements are logged, false otherwise.
|
||||
*/
|
||||
bool mxs_mysql_get_log_statements();
|
||||
|
||||
MXS_END_DECLS
|
||||
|
Reference in New Issue
Block a user