Chapter 5. Viewing and exporting logs

Activity logs are gathered for all repositories and namespaces (users and organizations) in Red Hat Quay. There are multiple ways of accessing log files, including:

  • Viewing logs through the web UI
  • Exporting logs so they can be saved externally.
  • Accessing log entries via the API

To access logs, you must have Admin privilege to the selected repository or namespace.

Note

A maximum of 100 log results are available at a time via the API. To gather more results that that, you must use the log exporter feature described in this chapter.

5.1. Viewing logs

To view log entries for a repository or namespace from the web UI, do the following:

  1. Select a repository or namespace (organization or user) for which you have Admin privileges.
  2. Select the Usage Logs icon from the left column. A Usage Logs screen appears, like the one shown in the following figure:

    View usage logs

  3. From the Usage Logs page, you can:

    • Set the date range for viewing log entries by adding dates to the From and to boxes. By default, the most recent one week of log entries is displayed.
    • Type a string into the Filter Logs box to display log entries that container the given string.
    • Toggle the arrow to the left of any log entry to see more or less text associated with that log entry.

5.2. Exporting repository logs

To be able to grab a larger number of log files and save them outside of the Red Hat Quay database, you can use the Export Logs feature. Here are a few things you should know about using Export Logs:

  • You can choose a range of dates for the logs you want to gather from a repository.
  • You can request that the logs be sent to you via an email attachment or directed to a callback URL.
  • You need Admin privilege to the repository or namespace to export logs
  • A maximum of 30 days of log data can be exported at a time
  • Export Logs only gathers log data that was previously produced. It does not stream logging data.
  • Your Red Hat Quay instance must be configured for external storage for this feature (local storage will not work).
  • Once the logs are gathered and available, you should immediately copy that data if you want to save it. By default, the data expires in an hour.

To use the Export Logs feature:

  1. Select a repository for which you have Admin privileges.
  2. Select the Usage Logs icon from the left column. A Usage Logs screen appears.
  3. Choose the From and to date range of the log entries you want to gather.
  4. Select the Export Logs button. An Export Usage Logs pop-up appears, as shown

    Enter email or callback URL to receive exported logs

  5. Enter the email address or callback URL you want to receive the exported logs. For the callback URL, you could use a URL to a place such as webhook.site.
  6. Select Start Logs Export. This causes Red Hat Quay to begin gathering the selected log entries. Depending on the amount of logging data being gathered, this can take anywhere from one minute to an hour to complete.
  7. When the log export is completed you will either:

    • Receive an email, alerting you to the availability of your requested exported log entries.
    • See a successful status of your log export request from the webhook URL. A link to the exported data will be available for you to select to download the logs.

Keep in mind that the URL points to a location in your Red Hat Quay external storage and is set to expire within an hour. So make sure you copy the exported logs before that expiration time if you intend to keep them.