This document explains common log viewing issues, and describes how to use the Google Cloud console to view and troubleshoot configuration mistakes or unexpected results.
Download of logs fails
You are using the Logs Explorer and click download Download. The command starts but then fails to complete or reports an error.
To resolve this issue, reduce the time it takes for the command to execute by trying the following:
- In the Download logs dialog, reduce the value of Maximum log entries.
- Reduce the time period over which logs are queried.
- In the query results toolbar, click Hide similar entries before you begin the download.
- Modify your query to use indexed fields.
Can't find console logs for a VM instance
Logs written to the console of a Compute Engine instance might not be available in the Logs Explorer. To view these logs, do the following:
-
In the Google Cloud console, go to the VM instances page:
If you use the search bar to find this page, then select the result whose subheading is Compute Engine.
Select the instance, and then select Serial port 1 (console) in the Logs section of the page.
You can configure your instances such that their serial port output is sent to Cloud Logging. For more information, see Enabling and disabling serial port output logging.
Get Google Cloud project or organization ID
To get a Google Cloud project or organization ID from anywhere in the Google Cloud console, expand the list of Google Cloud projects from the Google Cloud project and organization selector and find the Google Cloud project ID in the ID column.
Can't see log entries
If you don't see any log entries, check the following:
Verify that the correct Google Cloud project is selected.
Verify that your Google Cloud project is using resources that generate logs and that there is activity on those resources. Even if the Google Cloud project is new, it should have audit logs recording the fact that it was created. For information about how to verify that you're using a resource that generates logs, see Mapping services to resource types.
Ensure that the time range isn't too narrow.
View your current exclusion queries to ensure that the logs you're looking for aren't accidentally excluded.
Ensure that you have permission to view the log entries in the projects and log views referenced by setting of the Refine scope menu. For information about how to adjust the scope of your search, see Refine scope.
My query is correct but I still don't see log entries
You can't see log entries that are older than the Logging retention period. See Log retention periods for the logs retention period in effect.
During periods of heavy load, there could be delays in sending logs to Logging or in receiving and displaying the logs.
The Logs Explorer doesn't show log entries that have timestamps in the future until the current time has "caught up" with them. This is an unusual situation, probably caused by a time skew in the application sending the logs.
The query scope was set too large and couldn't complete within a reasonable amount of time. You might see this as "deadline expired before operation could complete". Try making your query more specific or reducing the time range.
Query returns an error
If you issue a query over a resource without specifying a bucket, then
Cloud Logging uses the history of the sinks in the Google Cloud project to
determine where entries might have been written for that resource. If
Cloud Logging identifies more than 200 buckets where entries
might have been written, then the query fails with the message
Error: Invalid query
.
To resolve this issue, refine the scope of your query to a subset of the storage. For more information, see Refine scope.
Query results time range doesn't match query
The logs data you see in the Query results and Log fields panes adjusts according to the time range captured by the histogram timeline. You adjust the histogram timeline using the histogram's time controls or the time-range selector. Adjusting these time controls doesn't alter the query expression in the Query pane.
When you have a query with a timestamp, the time-range selector is disabled. The query uses the timestamp expression as its time-range restriction. If a query doesn't use a timestamp expression, then the query uses the time-range selector as its time-range restriction.