Hello Habr!
Periodically there is a need to track the requests that your application sends to the database. For example:
- You need to debug / modify someone else's code;
- Requests are generated using a third-party library (for example, ActiveRecord), it is not clear which and how many;
- It is necessary to optimize the application: see what requests and how many of them, see explain these requests.
In these situations, Beaver mysql logger comes to the rescue.
To track requests, mysql console is enough; enable set global general_log = 'on'; and set global log_output = 'table'; and view the logs in the general_log table, but this is not convenient:
')
- lack of formatting and backlight;
- if several threads are running in parallel - it is visually more difficult to find the required query.
etc.
Since I had to look in general_log often, but I did not find any ready-made tools - I wrote
Beaver mysql logger .
Demo .
On the demo site, explain and execute are limited to one request for security purposes (the default query will always be executed, no matter which query you choose).
What can:- enable / disable general_log;
- output the log to a nice Web interface;
- search by logs;
- make explain requests;
- You can edit and execute the request;
- clear general_log.
You can download it from here:
Project site .
At detection of bugs - please report. Thank!