Export Firebase data into Cloud Logging

Exporting data from various Firebase products into Cloud Logging lets you view, search, and filter logs from your project and apps.

The following products support data export to Cloud Logging:

  • Firebase Hosting: After you set up export, Firebase exports web request logs from your Firebase Hosting sites to Cloud Logging.

  • Cloud Functions for Firebase: No need to set up export; Firebase automatically exports function logs to Cloud Logging.

This page helps you with the following:

Understand exports to Cloud Logging

Cloud Logging is provided by Google Cloud Observability Suite.

When you export your logs to Cloud Logging, you can use the Logs Viewer interface in the Google Cloud console to view, search, and filter these logs. You can use other Google Cloud tools to query your logs, create and use log-based metrics, and store your logs data. Learn more about these tools in the Cloud Logging documentation.

For Cloud Functions for Firebase, you can also view your logs in the Functions dashboard of the Firebase console.

Firebase Hosting

By using Cloud Logging with Hosting, you can track from where and when you have visits to your site, your site's response statuses, the latency of end user requests, and more.

If you have multiple Hosting sites in your project, you can select which of your Hosting sites will export logs. You can then filter and view your logs data by Hosting site and even by domain. By selecting specific Hosting sites to export logs, you can also control the amount of data processed for your project. To view the data usage for logs from your Hosting sites, visit the Cloud Logging integration card in the Firebase console.

Learn more about the Cloud Logging integration with Firebase Hosting.

Set up export to Cloud Logging

Here's how to set up export to Cloud Logging and select which Firebase Hosting sites you want to link to Cloud Logging.

  1. Sign in to the Firebase console, then select your project.

  2. Click , then select Project Settings.

  3. Select the Integrations tab.

  4. On the Cloud Logging integration card, click Link.

  5. Follow the on-screen instructions to set up Cloud Logging and select which Hosting sites will export logs.

    If you already have one or more active Hosting sites, the linking workflow displays an estimated data usage level for logs from each of your Hosting sites. This value is estimated from the past 30 days.

After linking, logs for any new requests to your Hosting sites will usually show up within 30 minutes of a request being made.

  • You can view the data usage level for logs from your Hosting sites in the Cloud Logging integration card in the Firebase console.

  • You can view your per-site data usage level in the Logs Viewer interface in the Google Cloud console (the log_bytes metric). If your project uses Cloud Logging for other products, you can also view total usage in the Logs Viewer interface.

By unlinking your Firebase project from Cloud Logging, you stop all Firebase Hosting exports to Cloud Logging. This action does not impact export of logs for Cloud Functions for Firebase.

Be aware of the following:

  • If you use Cloud Functions for Firebase, then your function logs will continue to be exported to Cloud Logging.

  • If you don't delete your datasets for Hosting logs in Cloud Logging, they will persist for 30 days, then be deleted from Cloud Logging automatically.

  • If you have Cloud Logging data for Hosting logs stored in other services (like BigQuery), that data might be governed by different terms for data persistence.

Here's how to unlink your Firebase project, specifically your Firebase Hosting sites, from Cloud Logging:

  1. Sign in to the Firebase console, then select your project.

  2. Click , then select Project Settings.

  3. Select the Integrations tab.

  4. On the Cloud Logging integration card, click Manage.

  5. At the bottom of the page, click Stop exports to Cloud Logging.

  6. Confirm that you want to unlink and stop all exports.

Cloud Logging quotas, pricing, and retention

Cloud Logging offers a no-cost level of usage per month (per project). The usage can be from any Google or Firebase product using Cloud Logging. You can upgrade your project to the pay-as-you-go Blaze pricing plan to unlock additional paid usage and features. Learn more about pricing for Cloud Logging.

You can monitor and manage Cloud Logging and billing:

Logs are automatically deleted after 30 days, with the option to set custom retention.

Note that the log entry for a particular request may be delayed or, in rare cases, dropped. While logs can be used to understand requests, they may not reflect the true usage that appears in your project usage and billing.