|
|
@@ -17,6 +17,7 @@ use Monolog\LogRecord;
|
|
|
/**
|
|
|
* Encodes message information into JSON in a format compatible with Cloud logging.
|
|
|
*
|
|
|
+ * @see https://cloud.google.com/logging/docs/structured-logging
|
|
|
* @see https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry
|
|
|
*
|
|
|
* @author Luís Cobucci <lcobucci@gmail.com>
|
|
|
@@ -28,7 +29,7 @@ final class GoogleCloudLoggingFormatter extends JsonFormatter
|
|
|
{
|
|
|
// Re-key level for GCP logging
|
|
|
$record['severity'] = $record['level_name'];
|
|
|
- $record['timestamp'] = $record['datetime']->format(DateTimeInterface::RFC3339_EXTENDED);
|
|
|
+ $record['time'] = $record['datetime']->format(DateTimeInterface::RFC3339_EXTENDED);
|
|
|
|
|
|
// Remove keys that are not used by GCP
|
|
|
unset($record['level'], $record['level_name'], $record['datetime']);
|