LogEntry represents a [structured Cloud Logging](https://cloud.google.com/logging/docs/structured-logging) entry. All keys aside from severity and message are included in the jsonPayload of the logged entry.
LogSeverity indicates the detailed severity of the log entry. See [LogSeverity](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#logseverity).
logger.debug()
Writes a DEBUG severity log. If the last argument provided is a plain object, it is added to the jsonPayload in the Cloud Logging entry.
Signature:
exportdeclarefunctiondebug(...args:any[]):void;
Parameters
Parameter
Type
Description
args
any[]
Arguments, concatenated into the log message with space separators.
Returns:
void
logger.error()
Writes an ERROR severity log. If the last argument provided is a plain object, it is added to the jsonPayload in the Cloud Logging entry.
Signature:
exportdeclarefunctionerror(...args:any[]):void;
Parameters
Parameter
Type
Description
args
any[]
Arguments, concatenated into the log message with space separators.
Returns:
void
logger.info()
Writes an INFO severity log. If the last argument provided is a plain object, it is added to the jsonPayload in the Cloud Logging entry.
Signature:
exportdeclarefunctioninfo(...args:any[]):void;
Parameters
Parameter
Type
Description
args
any[]
Arguments, concatenated into the log message with space separators.
Returns:
void
logger.log()
Writes an INFO severity log. If the last argument provided is a plain object, it is added to the jsonPayload in the Cloud Logging entry.
Signature:
exportdeclarefunctionlog(...args:any[]):void;
Parameters
Parameter
Type
Description
args
any[]
Arguments, concatenated into the log message with space separators.
Returns:
void
logger.warn()
Writes a WARNING severity log. If the last argument provided is a plain object, it is added to the jsonPayload in the Cloud Logging entry.
Signature:
exportdeclarefunctionwarn(...args:any[]):void;
Parameters
Parameter
Type
Description
args
any[]
Arguments, concatenated into the log message with space separators.
Returns:
void
logger.write()
Writes a LogEntry to stdout/stderr (depending on severity).
The LogEntry including severity, message, and any additional structured metadata.
Returns:
void
logger.LogSeverity
LogSeverity indicates the detailed severity of the log entry. See [LogSeverity](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#logseverity).
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-04-18 UTC."],[],[],null,["# logger namespace\n\nFunctions\n---------\n\n| Function | Description |\n|------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------|\n| [debug(args)](./firebase-functions.logger.md#loggerdebug) | Writes a `DEBUG` severity log. If the last argument provided is a plain object, it is added to the `jsonPayload` in the Cloud Logging entry. |\n| [error(args)](./firebase-functions.logger.md#loggererror) | Writes an `ERROR` severity log. If the last argument provided is a plain object, it is added to the `jsonPayload` in the Cloud Logging entry. |\n| [info(args)](./firebase-functions.logger.md#loggerinfo) | Writes an `INFO` severity log. If the last argument provided is a plain object, it is added to the `jsonPayload` in the Cloud Logging entry. |\n| [log(args)](./firebase-functions.logger.md#loggerlog) | Writes an `INFO` severity log. If the last argument provided is a plain object, it is added to the `jsonPayload` in the Cloud Logging entry. |\n| [warn(args)](./firebase-functions.logger.md#loggerwarn) | Writes a `WARNING` severity log. If the last argument provided is a plain object, it is added to the `jsonPayload` in the Cloud Logging entry. |\n| [write(entry)](./firebase-functions.logger.md#loggerwrite) | Writes a `LogEntry` to `stdout`/`stderr` (depending on severity). |\n\nInterfaces\n----------\n\n| Interface | Description |\n|------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [LogEntry](./firebase-functions.logger.logentry.md#loggerlogentry_interface) | `LogEntry` represents a \\[structured Cloud Logging\\](https://cloud.google.com/logging/docs/structured-logging) entry. All keys aside from `severity` and `message` are included in the `jsonPayload` of the logged entry. |\n\nType Aliases\n------------\n\n| Type Alias | Description |\n|-----------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [LogSeverity](./firebase-functions.logger.md#loggerlogseverity) | `LogSeverity` indicates the detailed severity of the log entry. See \\[LogSeverity\\](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#logseverity). |\n\nlogger.debug()\n--------------\n\nWrites a `DEBUG` severity log. If the last argument provided is a plain object, it is added to the `jsonPayload` in the Cloud Logging entry.\n\n**Signature:** \n\n export declare function debug(...args: any[]): void;\n\n### Parameters\n\n| Parameter | Type | Description |\n|-----------|---------|---------------------------------------------------------------------|\n| args | any\\[\\] | Arguments, concatenated into the log message with space separators. |\n\n**Returns:**\n\nvoid\n\nlogger.error()\n--------------\n\nWrites an `ERROR` severity log. If the last argument provided is a plain object, it is added to the `jsonPayload` in the Cloud Logging entry.\n\n**Signature:** \n\n export declare function error(...args: any[]): void;\n\n### Parameters\n\n| Parameter | Type | Description |\n|-----------|---------|---------------------------------------------------------------------|\n| args | any\\[\\] | Arguments, concatenated into the log message with space separators. |\n\n**Returns:**\n\nvoid\n\nlogger.info()\n-------------\n\nWrites an `INFO` severity log. If the last argument provided is a plain object, it is added to the `jsonPayload` in the Cloud Logging entry.\n\n**Signature:** \n\n export declare function info(...args: any[]): void;\n\n### Parameters\n\n| Parameter | Type | Description |\n|-----------|---------|---------------------------------------------------------------------|\n| args | any\\[\\] | Arguments, concatenated into the log message with space separators. |\n\n**Returns:**\n\nvoid\n\nlogger.log()\n------------\n\nWrites an `INFO` severity log. If the last argument provided is a plain object, it is added to the `jsonPayload` in the Cloud Logging entry.\n\n**Signature:** \n\n export declare function log(...args: any[]): void;\n\n### Parameters\n\n| Parameter | Type | Description |\n|-----------|---------|---------------------------------------------------------------------|\n| args | any\\[\\] | Arguments, concatenated into the log message with space separators. |\n\n**Returns:**\n\nvoid\n\nlogger.warn()\n-------------\n\nWrites a `WARNING` severity log. If the last argument provided is a plain object, it is added to the `jsonPayload` in the Cloud Logging entry.\n\n**Signature:** \n\n export declare function warn(...args: any[]): void;\n\n### Parameters\n\n| Parameter | Type | Description |\n|-----------|---------|---------------------------------------------------------------------|\n| args | any\\[\\] | Arguments, concatenated into the log message with space separators. |\n\n**Returns:**\n\nvoid\n\nlogger.write()\n--------------\n\nWrites a `LogEntry` to `stdout`/`stderr` (depending on severity).\n\n**Signature:** \n\n export declare function write(entry: LogEntry): void;\n\n### Parameters\n\n| Parameter | Type | Description |\n|-----------|------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|\n| entry | [LogEntry](./firebase-functions.logger.logentry.md#loggerlogentry_interface) | The `LogEntry` including severity, message, and any additional structured metadata. |\n\n**Returns:**\n\nvoid\n\nlogger.LogSeverity\n------------------\n\n`LogSeverity` indicates the detailed severity of the log entry. See \\[LogSeverity\\](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#logseverity).\n\n**Signature:** \n\n export type LogSeverity = \"DEBUG\" | \"INFO\" | \"NOTICE\" | \"WARNING\" | \"ERROR\" | \"CRITICAL\" | \"ALERT\" | \"EMERGENCY\";"]]