AppDynamics for Databases
2.9.x Documentation
MySQL provides a built-in function called load_file which is capable of reading a file from the file system and returning the results as a single column single row result set via SQL. This function can be used to read the error log using the following technique:
Locate the MySQL Error Log, from a command shell enter the following:
C:\> C:\AppD4DBInstallDir\mysql\bin\startClient.bat mysql> show variables like 'log_error';
The system should return something like the following:
+-------------------------------------------------------------------+ | Variable_name | Value | +-------------------------------------------------------------------+ | log_error | C:\AppD4DBInstallDir\mysql\data\hostname.err | +-------------------------------------------------------------------+
Check that you can read the file from the command line:
mysql> select load_file ('C:\AppD4DBInstallDir\mysql\data\hostname.err');
You can then use a custom SQL alert to monitor the log file by creating a diff alert, which will notify you of changes to the log file: