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
orwarning
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.
Pricing
For pricing information about Cloud Logging, see Cloud Logging costs.
Get required roles
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.
This predefined role contains the permissions required to use Cloud Logging.
For more information about the Logs Writer role, see the
IAM documentation about roles/logging.logWriter
.
For instructions on granting roles for projects, see Manage access to projects.
Before you begin
Enable the Cloud Storage API.
Enable the Cloud Logging API.
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 theseverity
field totrace
.
Forward Cloud Storage FUSE logs to Cloud Logging
Specify
/gcsfuse.log
for yourgcsfuse
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 areceiver
element which receives logs from the/gcsfuse.log
file. Theservice
element links thereceiver
element in the pipeline.logging: receivers: gcsfuse_trace_logs: type: files include_paths: - /gcsfuse.log service: pipelines: gcsfuse_pipeline: receivers: [gcsfuse_trace_logs]
To learn about additional logging configurations, see Cloud Logging configurations.
Put the configuration for the Cloud Ops Agent in a path based on your operating system. To choose which path to put the configuration, see the Google Cloud Observability documentation for user-specified configurations.
Restart the Cloud Ops Agent to pick up new configuration changes using the
systemctl restart
command:sudo systemctl restart google-cloud-ops-agent`
Go to Cloud Logging in the Google Cloud console.
Run the
fuse_debug
filtering query to validate thegcsfuse
trace logs that are forwarded to Cloud Logging.
What's next
- Learn how you can improve Cloud Storage FUSE performance.