This page describes how to find and use Cloud Logging to query and view maintenance logs for a cluster in Memorystore for Redis Cluster.
View logs for scheduled maintenance
You can use the Google Cloud console to query and view logs for scheduled maintenance.
Console
In the Google Cloud console, go to the Logs Explorer page.
At the top of the page, select your Google Cloud project.
From the time-range menu, select a range for which you want to query maintenance logs. For example, you can query for logs that Memorystore for Redis Cluster captured over the past 30 days.
In the Query builder, add the following lines of code:
logName="projects/PROJECT_NAME/logs/maintenance.googleapis.com%2Factivity_log" labels.activity_type_name="CloudRedisClusterRolloutAdvanced"
Replace PROJECT_NAME with the name of your Google Cloud project.
Click Run query. The logs appear for scheduled maintenance.
View logs for in-progress maintenance
You can use the Google Cloud console to query and view logs for maintenance that's in progress.
Console
In the Google Cloud console, go to the Logs Explorer page.
At the top of the page, select your Google Cloud project.
From the time-range menu, select a range for which you want to query maintenance logs. For example, you can query for logs that Memorystore for Redis Cluster captured over the past 30 days.
In the Query builder, add the following lines of code:
logName="projects/PROJECT_NAME/logs/maintenance.googleapis.com%2Factivity_log" labels.activity_type_name="CloudRedisClusterRolloutInProgress" labels.is_completed="false"
Replace PROJECT_NAME with the name of your Google Cloud project.
Click Run query. The logs appear for maintenance that's in progress.
View logs for completed maintenance
You can use the Google Cloud console to query and view logs for maintenance that's completed.
Console
In the Google Cloud console, go to the Logs Explorer page.
At the top of the page, select your Google Cloud project.
From the time-range menu, select a range for which you want to query maintenance logs. For example, you can query for logs that Memorystore for Redis Cluster captured over the past 30 days.
In the Query builder, add the following lines of code:
logName="projects/PROJECT_NAME/logs/maintenance.googleapis.com%2Factivity_log" labels.activity_type_name="CloudRedisClusterRolloutInProgress" labels.is_completed="true"
Replace PROJECT_NAME with the name of your Google Cloud project.
Click Run query. The logs appear for maintenance that's completed.
View logs for canceled maintenance
You can use the Google Cloud console to query and view logs for maintenance that's canceled.
Console
In the Google Cloud console, go to the Logs Explorer page.
At the top of the page, select your Google Cloud project.
From the time-range menu, select a range for which you want to query maintenance logs. For example, you can query for logs that Memorystore for Redis Cluster captured over the past 30 days.
In the Query builder, add the following lines of code:
logName="projects/PROJECT_NAME/logs/maintenance.googleapis.com%2Factivity_log" labels.activity_type_name="CloudRedisClusterRolloutCanceled"
Replace PROJECT_NAME with the name of your Google Cloud project.
Click Run query. The logs appear for maintenance that's canceled.
Troubleshoot
This section lists issues that you might encounter when you try to view maintenance logs and provides guidance for resolving these issues.
You deactivate the _Default sink in Cloud Logging
In Logging, every project, folder, and organization has the following sinks:
_Required: capture audit logs and store them in the_Requiredbucket.You can't deactivate or delete this sink. Also, the logs in the bucket have a default retention period of 400 days.
_Default: route any Memorystore for Redis Cluster logs, including maintenance logs, that the_Requiredsink doesn't capture. The_Defaultsink stores these logs in the_Defaultbucket.Although you can't delete the
_Defaultsink, you can deactivate it to stop it from routing logs to the_Defaultbucket. Also, the logs in the bucket have a default retention period of 30 days.
If you deactivate the _Default sink, then Logging drops all
logs in the sink, including the maintenance.googleapis.com/activity_log, which
is associated with all maintenance activities in Logging. As a
result, Logging can't store the logs in the sink.
To check if you deactivated the _Default sink, do the following:
Use the
gcloud logging sinks describecommand.gcloud logging sinks describe _Default --project=PROJECT_ID
Replace PROJECT_ID with the ID or project number of the Google Cloud project that contains the sink.
In the output, look at the value of the
disabledparameter. If the value istrue, then you deactivated the sink and you must re-enable it.
To re-enable the sink, do the following:
Use the
gcloud logging sinks updatecommand.gcloud logging sinks update _Default --no-disabled --project=PROJECT_ID
To verify that the sink is enabled, use the
gcloud logging sinks describecommand.gcloud logging sinks describe _Default --project=PROJECT_ID
In the output, confirm that the value of the
disabledparameter isfalse. You re-enabled the sink.
You don't configure sink filters correctly
In Logging, you can customize sinks to control which logs are stored in a Google Cloud project. To do this, create filters to specify the types of logs that you want the sinks to contain.
If you don't configure a filter for at least one sink to include logs with the
log ID of maintenance.googleapis.com/activity_log, then Logging
drops these logs. Because these logs are associated with all maintenance
activities in Logging, you can't view the maintenance logs.
To check if the sink filters are configured correctly, do the following:
Use the
gcloud logging sinks listcommand.gcloud logging sinks list --project=PROJECT_ID
Replace PROJECT_ID with the ID or project number of the Google Cloud project that contains the sink.
Examine the
FILTERcolumn to see if it includes theLOG_ID("maintenance.googleapis.com/activity_log")filter. If either this filter doesn't appear or there's a broader filter that excludes this log (for example,(NOT LOG_ID("cloudaudit.googleapis.com/activity_log)")), then you customized all sinks to drop logs with the log ID ofmaintenance.googleapis.com/activity_log.To resolve this, you must either create or update a sink to include the maintenance logs. For the
--log-filterparameter, specifyLOG_ID("maintenance.googleapis.com/activity_log")as the filter.