View logs and metrics

Logging and metrics are important tools for debugging and monitoring code.App Hosting provides quick access to view logs and metrics for the GoogleCloud services powering your web app:Cloud Run,Cloud Build and Cloud CDN.

Using standard logging syntax like Node.js'console.log, you can write logentries toCloud Logging.

View usage in the console

Each backend has anOverview tab, with a summary of your app's traffic(request count) and error rate over the past seven days.

TheLogs tab for a backend lets you view and filter "Build logs"(fromCloud Build) and "Runtime logs" (fromCloud Run andCloud CDN).

Each backend also has aUsage tab with several usagegraphs for activity and usage of your app. The data represented includes CDNbandwidth and requests, Cloud Run CPU and memory utilization, and more.

You can find additional utilization metrics for Cloud Run (such as CPUutilization and Memory utilization), in the Google Cloud console.

View logs in the console

From theFirebase console context menu (a 3-dot menu at upper right) for arollout, you can get quick access to view theCloud Run revisiondetails and errors as well as build logs.

These logs contain helpful information for debugging yourApp Hostingdeployments. For example, theCloud Run log notes whenpackage.jsonis not found.

The build log displays your build output, allowing you to triagewhether errors occurred in configuration in your framework, or inApp Hosting configuration. It also displays your basicrunConfig settings,and indicates when settings are missing or whenapphosting.yaml does notexist:

> next build   ▲ Next.js 14.1.4   -   Environments: .env   ...Route (app)                              Size     First Load JS┌ λ /                                    4.79 kB         214 kB├ λ /_not-found                          882 B          85.3 kB└ λ /restaurant/[id]                     5.28 kB         207 kB+   First Load JS shared by all            84.4 kB  ├ chunks/69-6678c81190a8fe82.js        29 kB  ├ chunks/fd9d1056-51920e345d2966e8.js  53.4 kB  └ other shared chunks (total)          1.98 kB

Write logs toCloud Logging

If you want to log custom events, you can write toCloud Logging fromCloud Run, where your server-rendered code runs. Use standardJavaScript logging calls such asconsole.log andconsole.error. For example,to write a custom entry from code for aNext.js route handler,you would do something like this:

  • console.log() commands have theINFO log level.
  • console.info() commands have theINFO log level.
  • console.warn() commands have theERROR log level.
  • console.error() commands have theERROR log level.
  • Internal system messages have theDEBUG log level.

Note thatconsole.log pipes through toCloud Logging in theserver-rendered code for your app. Events related to static rendering are senttoCloud Build logs, while server rendering are sent toCloud Runlogs.

View server errors

Cloud Error Reportingconsolidates errors from yourApp HostingCloud Run instance.You can optionally configureCloud Error Reporting tonotify you when new errors arise.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-05 UTC.