Stay organized with collections
Save and categorize content based on your preferences.
This page provides instructions on how to forward Cloud Storage FUSE logs to
Cloud Logging.
Overview
Cloud Storage FUSE logs help you understand how Cloud Storage FUSE operates and allow you
to troubleshoot issues and monitor performance. When you use the
--log-severity CLI option or the
logging:severity configuration field to generate logs, logs are generated
by Cloud Storage FUSE and can be viewed as standard output or local log files on the
machine where Cloud Storage FUSE is running.
You can also forward Cloud Storage FUSE logs to Cloud Logging, which provides the
following benefits:
View all Cloud Storage FUSE logs in a single location in the Google Cloud console, which
provides a holistic view of Cloud Storage FUSE behavior and makes it
easier to correlate events across different components.
Filter Cloud Storage FUSE logs by severity level, timestamp, resource type, and
other fields, which can help you pinpoint errors or performance issues.
Create metrics-based alerts that are triggered by specific log events. For
example, you can set up an alert to notify you whenever an error or
warning log message from Cloud Storage FUSE is detected, allowing you
to react to problems proactively.
Store logs in Cloud Logging for a configurable period, and export them to
Cloud Storage for long-term storage, archival, or in-depth analysis.
To get the permissions that you need to use Cloud Logging to view
Cloud Storage FUSE logs, grant the Logs Writer (roles/logging.logWriter)
IAM role on the project you want to collect metrics for.
Install the Cloud Ops Agent, which is Google Cloud's primary agent for
collecting logs and metrics. Select an installation method based on the type
of virtual machine you're using.
Set the logging severity to trace by using either the
--log-severity CLI option or the severity field to trace.
Forward Cloud Storage FUSE logs to Cloud Logging
Specify /gcsfuse.log for your gcsfuse mount:
logging:
file-path:"/gcsfuse.log"severity:trace
Configure the Cloud Ops Agent to forward logs from the /gcfuse.log file
to Cloud Logging using the following configuration. In this configuration,
gcsfuse_trace_logs is a receiver element which receives logs from the
/gcsfuse.log file. The service element links the receiver element in
the pipeline.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Forward Cloud Storage FUSE logs to Cloud Logging\n\nThis page provides instructions on how to forward Cloud Storage FUSE logs to\n[Cloud Logging](/logging/docs/overview).\n\nOverview\n--------\n\nCloud Storage FUSE logs help you understand how Cloud Storage FUSE operates and allow you\nto troubleshoot issues and monitor performance. When you use the\n[`--log-severity` CLI option](/storage/docs/cloud-storage-fuse/cli-options#log-severity) or the\n[`logging:severity` configuration field](/storage/docs/cloud-storage-fuse/config-file#severity) to generate logs, logs are generated\nby Cloud Storage FUSE and can be viewed as standard output or local log files on the\nmachine where Cloud Storage FUSE is running.\n\nYou can also forward Cloud Storage FUSE logs to Cloud Logging, which provides the\nfollowing benefits:\n\n- View all Cloud Storage FUSE logs in a single location in the Google Cloud console, which\n provides a holistic view of Cloud Storage FUSE behavior and makes it\n easier to correlate events across different components.\n\n- Filter Cloud Storage FUSE logs by severity level, timestamp, resource type, and\n other fields, which can help you pinpoint errors or performance issues.\n\n- Create metrics-based alerts that are triggered by specific log events. For\n example, you can set up an alert to notify you whenever an `error` or\n `warning` log message from Cloud Storage FUSE is detected, allowing you\n to react to problems proactively.\n\n- Store logs in Cloud Logging for a configurable period, and export them to\n Cloud Storage for long-term storage, archival, or in-depth analysis.\n\nPricing\n-------\n\nFor pricing information about Cloud Logging, see\n[Cloud Logging costs](/stackdriver/pricing#logging-costs).\n\nGet required roles\n------------------\n\nTo get the permissions that you need to use Cloud Logging to view\nCloud Storage FUSE logs, grant the [Logs Writer](/iam/docs/roles-permissions/logging#logging.logWriter) (`roles/logging.logWriter`)\nIAM role on the project you want to collect metrics for.\n\nThis predefined role contains the permissions required to use Cloud Logging.\nFor more information about the Logs Writer role, see the\n[IAM documentation about `roles/logging.logWriter`](/iam/docs/roles-permissions/logging#logging.logWriter).\n\nFor instructions on granting roles for projects, see\n[Manage access to projects](/iam/docs/granting-changing-revoking-access).\n\nBefore you begin\n----------------\n\n1. Enable the Cloud Storage API.\n\n [Go to Cloud Storage API](https://console.cloud.google.com/flows/enableapi?apiid=storage-component.googleapis.com&_ga=2.70110096.1642044780.1726157710-823539626.1726157710)\n2. Enable the Cloud Logging API.\n\n [Go to Cloud Logging API](https://console.cloud.google.com/flows/enableapi?apiid=logging.googleapis.com)\n3. [Install the Cloud Ops Agent](/stackdriver/docs/solutions/agents/ops-agent/install-index), which is Google Cloud's primary agent for\n collecting logs and metrics. Select an installation method based on the type\n of virtual machine you're using.\n\n4. Set the logging severity to `trace` by using either the\n [`--log-severity`](/storage/docs/cloud-storage-fuse/cli-options#log-severity) CLI option or the [`severity`](/storage/docs/cloud-storage-fuse/config-file#severity) field to `trace`.\n\nForward Cloud Storage FUSE logs to Cloud Logging\n------------------------------------------------\n\n1. Specify `/gcsfuse.log` for your `gcsfuse` mount:\n\n logging:\n file-path: \"/gcsfuse.log\"\n severity: trace\n\n2. Configure the Cloud Ops Agent to forward logs from the `/gcfuse.log` file\n to Cloud Logging using the following configuration. In this configuration,\n `gcsfuse_trace_logs` is a `receiver` element which receives logs from the\n `/gcsfuse.log` file. The `service` element links the `receiver` element in\n the pipeline.\n\n logging:\n receivers:\n gcsfuse_trace_logs:\n type: files\n include_paths:\n - /gcsfuse.log\n service:\n pipelines:\n gcsfuse_pipeline:\n receivers: [gcsfuse_trace_logs]\n\n To learn about additional logging configurations, see\n [Cloud Logging configurations](/stackdriver/docs/solutions/agents/ops-agent/configuration#logging-config).\n3. Put the configuration for the Cloud Ops Agent in a path\n based on your operating system. To choose which path to put the\n configuration, see the\n [Google Cloud Observability documentation for user-specified configurations](/storage/docs/cloud-storage-fuse/stackdriver/docs/solutions/agents/ops-agent/configuration#file-location).\n\n4. Restart the Cloud Ops Agent to pick up new configuration changes using the\n `systemctl restart` command:\n\n sudo systemctl restart google-cloud-ops-agent`\n\n5. Go to Cloud Logging in the Google Cloud console.\n\n6. Run the `fuse_debug` filtering query to validate the `gcsfuse` trace logs\n that are forwarded to Cloud Logging.\n\nWhat's next\n-----------\n\n- Learn how you can [improve Cloud Storage FUSE performance](/storage/docs/cloud-storage-fuse/performance)."]]