[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-08-31 UTC。"],[],[],null,["\u003cbr /\u003e\n\nLogging and metrics are important tools for debugging and monitoring code.\nApp Hosting provides quick access to view logs and metrics for the Google\nCloud services powering your web app:\nCloud Run, Cloud Build and Cloud CDN.\n\nUsing standard logging syntax like Node.js' `console.log`, you can write log\nentries to Cloud Logging.\n\nView usage in the console\n\nEach backend has an **Overview** tab, with a summary of your app's traffic\n(request count) and error rate over the past seven days.\n\nEach backend also has a **Usage** tab with several usage\ngraphs for activity and usage of your app. The data represented includes CDN\nbandwidth and requests, Cloud Run CPU and memory utilization, and more.\n\nYou can find additional utilization metrics for Cloud Run (such as CPU\nutilization and Memory utilization), in the Google Cloud console.\n\nView logs in the console\n\nFrom the Firebase console context menu (a 3-dot menu at upper right) for a\nrollout, you can get quick access to view the Cloud Run revision\ndetails and errors as well as build logs.\n\nThese logs contain helpful information for debugging your App Hosting\ndeployments. For example, the Cloud Run log notes when `package.json`\nis not found.\n\nThe build log displays your build output, allowing you to triage\nwhether errors occurred in configuration in your framework, or in\nApp Hosting configuration. It also displays your basic `runConfig` settings,\nand indicates when settings are missing or when `apphosting.yaml` does not\nexist: \n\n \u003e next build\n\n ▲ Next.js 14.1.4\n - Environments: .env\n\n ...\n\n Route (app) Size First Load JS\n ┌ λ / 4.79 kB 214 kB\n ├ λ /_not-found 882 B 85.3 kB\n └ λ /restaurant/[id] 5.28 kB 207 kB\n + First Load JS shared by all 84.4 kB\n ├ chunks/69-6678c81190a8fe82.js 29 kB\n ├ chunks/fd9d1056-51920e345d2966e8.js 53.4 kB\n └ other shared chunks (total) 1.98 kB\n\nWrite logs to Cloud Logging\n\nIf you want to log custom events, you can write to Cloud Logging from\nCloud Run, where your server-rendered code runs. Use standard\nJavaScript logging calls such as `console.log` and `console.error`. For example,\nto write a custom entry from code for a\n[Next.js route handler](https://www.google.com/url?q=https://nextjs.org/docs/app/building-your-application/routing/route-handlers),\nyou would do something like this:\n\n- `console.log()` commands have the **INFO** log level.\n- `console.info()` commands have the **INFO** log level.\n- `console.warn()` commands have the **ERROR** log level.\n- `console.error()` commands have the **ERROR** log level.\n- Internal system messages have the **DEBUG** log level.\n\nNote that `console.log` pipes through to Cloud Logging in the\n*server-rendered* code for your app. Events related to static rendering are sent\nto Cloud Build logs, while server rendering are sent to Cloud Run\nlogs.\n\nView server errors\n\n[Cloud Error Reporting](https://www.google.com/url?q=https://cloud.google.com/error-reporting/docs/grouping-errors)\nconsolidates errors from your App Hosting Cloud Run instance.\nYou can optionally configure\nCloud Error Reporting to\n[notify you when new errors arise](https://cloud.google.com/error-reporting/docs/notifications)."]]