

You can view logs for functions in the Google Cloud Console. To view logs for a specific function, provide the function name as an argument: firebase functions:log -only įor the full range of log viewing options, view the help for functions:log: firebase help functions:log To view logs with the firebase tool, use the functions:log command: firebase functions:log Logs for Cloud Functions are viewable either in theĬloud Logging UI, or via the firebase command-line tool. Internal system messages have the DEBUG log level.


console.log() commands have the INFO log level.make sure that the log was written successfully. The log.write() call returns a Promise if you want to console and other human-readable logging surfaces Optional 'message' property will show up in the Firebase This can be a JSON object with any properties log entries appear in the Cloud Functions logs viewer. Cloud Function called 'Custom Metrics' in order to make your custom This metadata is attached to each log entry. be automatically inferred from the Cloud Functions environment.Ĭonst log = logging.log('my-custom-log-name') Structured data attached to the log as the last argument: const =. Here's an object:", someObj) Īlternatively, you can use individual exports.

ForĮxample: const functions = require("firebase-functions") į("Hello from info. The logger SDK supports log entries as part of a wildcard import. You can use this SDK to log events with structured data, Similar api to console.log statements and supports other log levels. The Cloud Functions logger SDK provides a standard interface that has a You're familiar with Cloud Logging (formerly StackDriver logging) and prefer.You have an existing code base and prefer not to refactor from console.log.You might choose one of the other options for these reasons: Logging is an important tool for debugging and monitoring code.Ĭloud Functions gives you the option of using its logger SDK, custom GoogleĬloud Logging, or the console object standard for developing for the web.
