View your Lightsail database logs and history - Amazon Lightsail

View your Lightsail database logs and history

View your database logs and history of changes in the Amazon Lightsail console. Database logs provide useful information that could help you diagnose issues with your database. Likewise, database history shows you changes made to your database, which allows you to associate problems with a recent change.

To view your database logs
  1. Sign in to the Lightsail console.

  2. On the Lightsail home page, choose the Databases tab.

  3. Choose the name of the database for which you want to view logs.

  4. Choose the Logs and history tab.

    The page displays the database logs and history of changes made to your database.

  5. Choose a database log. The following database logs are available:

    MySQL database logs

    • Error log — A record of mysqld start up and shutdown times. It also contains diagnostic messages such as errors, warnings, and notes that occur during server start up and shutdown, and while the server is running. For more information, see the error log article in the MySQL 5.6, MySQL 5.7, or MySQL 8.0 documentation.

    • General log — A general record of what mysqld is doing. The server writes information to this log when clients connect or disconnect, and logs each SQL statement received from clients. For more information, see the general query log article in the MySQL 5.6, MySQL 5.7, or MySQL 8.0 documentation.

    • Slow query log — A record of SQL statements that took more than long_query_time seconds to run, and required at least min_examined_row_limit rows to be examined. For more information, see the slow query log article in the MySQL 5.6, MySQL 5.7, or MySQL 8.0 documentation.

    Note

    The general and slow query logs are disabled by default for MySQL databases. You can enable these logs, and begin collecting data, by updating a few database parameters. For more information, see Enabling the MySQL database general and slow query logs in Amazon Lightsail.

    PostgreSQL database logs

    • Postgres log — A record of database start up and shutdown times. It can also contain diagnostics, such as errors, warnings, notices, and debug messages that occur during database start up, shutdown, and while the database is running. For more information, see the error reporting and logging article in the PostgreSQL 9.6, PostgreSQL 10, PostgreSQL 11, or PostgreSQL 12 documentation.