Property | Type | Description | |
---|---|---|---|
$logger | The logger used to write entries. |
Method | Description | |
---|---|---|
__construct ( |
||
alert ( string $message, array $context = [] ) | Log an alert entry. | |
critical ( string $message, array $context = [] ) | Log a critical entry. | |
debug ( string $message, array $context = [] ) | Log a debug entry. | |
emergency ( string $message, array $context = [] ) | Log an emergency entry. | |
error ( string $message, array $context = [] ) | Log an error entry. | |
info ( string $message, array $context = [] ) | Log an info entry. | |
log ( string | integer $level, string $message, array $context = [] ) | Write a log entry. | |
notice ( string $message, array $context = [] ) | Log a notice entry. | |
warning ( string $message, array $context = [] ) | Log a warning entry. |
Method | Description | |
---|---|---|
validateLogLevel ( string | integer $level ) : boolean | Validates whether or not the provided log level exists. |
public __construct ( |
||
$logger | The logger used to write entries. | |
$messageKey | string | The key in the `jsonPayload` used to contain the logged message. **Defaults to** `message`. |
public log ( string | integer $level, string $message, array $context = [] ) | ||
$level | string | integer | The severity of the log entry. |
$message | string | The message to log. |
$context | array | { Context is an associative array which can include placeholders to be used in the `$message`. Placeholders must be delimited with a single opening brace `{` and a single closing brace `}`. The context will be added as additional information on the `jsonPayload`. Please note that the key `stackdriverOptions` is reserved for logging Google Stackdriver specific data. @type array $stackdriverOptions['resource'] The [monitored resource](https://cloud.google.com/logging/docs/api/reference/rest/Shared.Types/MonitoredResource) to associate this log entry with. **Defaults to** type global. @type array $stackdriverOptions['httpRequest'] Information about the HTTP request associated with this log entry, if applicable. Please see [the API docs](https://cloud.google.com/logging/docs/api/reference/rest/Shared.Types/LogEntry#httprequest) for more information. @type array $stackdriverOptions['labels'] A set of user-defined (key, value) data that provides additional information about the log entry. @type array $stackdriverOptions['operation'] Additional information about a potentially long-running operation with which a log entry is associated. Please see [the API docs](https://cloud.google.com/logging/docs/api/reference/rest/Shared.Types/LogEntry#logentryoperation) for more information. } |