AWS RDSDatabase

How to Enable General Logs and Error Logs in AWS RDS

In this blog, we discuss How to enable General Logs and Error Logs in AWS RDS.

You can monitor Mysql General logs and Error logs directly through the Amazon RDS console, the Amazon RDS API, the Amazon RDS CLI, or the AWS SDKs.

MySQL Error Logs

The MySQL error log file is generated by default. It is written to mysql-error.log file. MySQL writes to the error log only on startup, shutdown, and when it encounters errors

General Logs

It records all information to this log when clients connect or disconnect, and it logs each SQL statement received from clients. The general query log can be very useful when you suspect an error in a client and want to know exactly what the client sent to mysqld.

You can enable general logs by setting parameters in a DB Parameters groups that you have created for your MySQL instance.

Steps to modify DB Parameter Group

  1. Login to AWS Management Console
  2. Goto RDS Service
  3. In the navigation pane, choose Parameter Groups. The available DB parameter groups appear in a list.
  4. In the list, select the parameter group you want to modify.
  5. Choose Edit Parameters and set the following parameters to the specified values:
    General_log = 1 (default is 0 or no logging)

         Choose any one logging method:
log_output=FILE, to allow viewing the logs from the console.
log_output=TABLE, to allow viewing logs with a query.

  1. Choose Save Changes.

It is advisable to enable general log only if you are actively troubleshooting issues. General log captures all SQL statements received from the client. If it is enabled and left unchecked, it will quickly grow and end up utilizing most of your storage. I would recommend turning this parameter OFF if you are not actively troubleshooting for errors from client connections.

 

Read this also:

HOW TO ENABLE SLOW QUERY LOGS IN AWS RDS MYSQL

Related Articles

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close

Adblock Detected

Please consider supporting us by disabling your ad blocker