[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-05。"],[],[],null,["# Troubleshoot Logs Explorer\n\nThis document explains common log viewing issues, and describes how to use the\nGoogle Cloud console to view and troubleshoot configuration mistakes or\nunexpected results.\n\n### Download of logs fails\n\nYou are using the Logs Explorer and click\n*download* **Download**.\nThe command starts but then fails to complete or reports an error.\n\nTo resolve this issue, reduce the time it takes for the command to execute\nby trying the following:\n\n- In the **Download logs** dialog, reduce the value of **Maximum log entries**.\n- Reduce the time period over which logs are queried.\n- In the query results toolbar, click **Hide similar entries** before you begin the download.\n\n\u003c!-- --\u003e\n\n- Modify your query to use [indexed fields](/logging/docs/analyze/custom-index).\n\n| **Note:** The download feature isn't intended for the bulk download of logs. You can [copy logs](/logging/docs/routing/copy-logs) to a Cloud Storage bucket.\n\n### Can't find console logs for a VM instance\n\nLogs written to the console of a Compute Engine instance might not be available in the Logs Explorer.\nTo view these logs, do the following:\n\n1. In the Google Cloud console, go to the **VM instances** page:\n\n [Go to **VM instances**](https://console.cloud.google.com/compute/instances)\n\n \u003cbr /\u003e\n\n If you use the search bar to find this page, then select the result whose subheading is\n **Compute Engine**.\n2. Select the instance, and then select **Serial port 1 (console)** in the\n **Logs** section of the page.\n\nYou can configure your instances such that their serial port output is\nsent to Cloud Logging. For more information, see\n[Enabling and disabling serial port output logging](/compute/docs/troubleshooting/viewing-serial-port-output#enable-stackdriver).\n\n### Get Google Cloud project or organization ID\n\nTo get a Google Cloud project or organization ID from anywhere in the\nGoogle Cloud console, expand the list of Google Cloud projects from the\nGoogle Cloud project and organization selector and find the\nGoogle Cloud project ID in the **ID** column.\n\n### Can't see log entries\n\nIf you don't see any log entries, check the following:\n\n- Verify that the correct Google Cloud project is selected.\n\n- Verify that your Google Cloud project is using resources that generate\n logs and that there\n is activity on those resources. Even if the Google Cloud project is\n new, it should have audit logs recording the fact that it was created.\n For information about how to verify that\n you're using a resource that generates logs, see\n [Mapping services to resource types](/logging/docs/api/v2/resource-list#resource-mappings).\n\n- Ensure that the time range isn't too narrow.\n\n- View your\n [current exclusion queries](/logging/docs/exclusions#viewing-exclusion-filters)\n to ensure that the logs you're looking for aren't accidentally excluded.\n\n- Ensure that you have permission to view the log entries in the projects and\n log views referenced by setting of the **Refine scope** menu.\n For information about how to adjust the scope of your search, see\n [Refine scope](/logging/docs/view/logs-explorer-interface#refine_scope).\n\n### My query is correct but I still don't see log entries\n\n- You can't see log entries that are older than the Logging\n retention period. See\n [Log retention periods](/logging/quotas#logs_retention_periods) for the\n logs retention period in effect.\n\n- During periods of heavy load, there could be delays in sending logs to\n Logging or in receiving and displaying the logs.\n\n- The Logs Explorer doesn't show log entries that have timestamps in the\n future until the current time has \"caught up\" with them. This is an unusual\n situation, probably caused by a time skew in the application sending the\n logs.\n\n- The query scope was set too large and couldn't complete within a reasonable\n amount of time. You might see this as \"deadline expired before\n operation could complete\". Try making your query more specific or reducing\n the time range.\n\n### Query returns an error\n\nIf you issue a query over a resource without specifying a bucket, then\nCloud Logging uses the history of the sinks in the Google Cloud project to\ndetermine where entries might have been written for that resource. If\nCloud Logging identifies more than 200 buckets where entries\nmight have been written, then the query fails with the message\n`Error: Invalid query`.\n\nTo resolve this issue, refine the scope of your query to a subset of the\nstorage. For more information, see\n[Refine scope](/logging/docs/view/logs-explorer-interface#refine_scope).\n\n### Query results time range doesn't match query\n\nThe logs data you see in the **Query results** and **Fields** pane adjusts\naccording to the time range captured by the histogram timeline. You adjust the\nhistogram timeline using the histogram's time controls or the\n[time-range selector](/logging/docs/view/building-queries#time-range).\nAdjusting these time controls doesn't alter\nthe query expression in the **Query** pane.\n\nWhen you have a query with a timestamp, the time-range selector is disabled.\nThe query uses the timestamp expression as its time-range restriction.\nIf a query doesn't use a timestamp expression, then the query uses the\ntime-range selector as its time-range restriction."]]