Last active
August 20, 2017 20:15
-
-
Save ozh/fe2bab6361cb981e3d7b0546be5424a4 to your computer and use it in GitHub Desktop.
Enable query log in YOURLS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Needs YOURLS 1.7.3+ with PDO/AuraSQL | |
| $sql = "SET GLOBAL log_output = 'FILE';"; | |
| $ydb->exec($sql); | |
| $sql = "SET GLOBAL general_log_file = '/path/to/logfile.log';"; | |
| $ydb->exec($sql); | |
| $sql = "SET GLOBAL general_log = 'ON';"; | |
| $ydb->exec($sql); | |
| /* | |
| For instance, shows that when: | |
| $ydb->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); (default is true) | |
| the MySQL engine receive one query for prepare and one query for execute | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment