Skip to content

Commit b4e4489

Browse files
authored
fix: update write log sample to setup severity (GoogleCloudPlatform#1915)
1 parent 338fab3 commit b4e4489

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

logging/src/write_log.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
// [START logging_write_log_entry]
2121
use Google\Cloud\Logging\LoggingClient;
22+
use Google\Cloud\Logging\Logger;
2223

2324
/** Write a log message via the Stackdriver Logging API.
2425
*
@@ -37,7 +38,9 @@ function write_log($projectId, $loggerName, $message)
3738
]
3839
]
3940
]);
40-
$entry = $logger->entry($message);
41+
$entry = $logger->entry($message, [
42+
'severity' => Logger::INFO
43+
]);
4144
$logger->write($entry);
4245
printf("Wrote a log to a logger '%s'." . PHP_EOL, $loggerName);
4346
}

0 commit comments

Comments
 (0)