Skip to content

Commit 6ccd02e

Browse files
authored
Simplify Logging Example for App Engine php72 (GoogleCloudPlatform#839)
1 parent e30e15e commit 6ccd02e

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

appengine/php72/logging/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ these two steps:
1313
1. Create a [PSR-3][psr3]-compatible logger object
1414
```php
1515
use Google\Cloud\Logging\LoggingClient;
16-
$logging = new LoggingClient();
17-
$logger = $logging->psrLogger('app', ['batchEnabled' => true]);
16+
// Create a PSR-3-Compatible logger
17+
$logger = LoggingClient::psrBatchLogger('app');
1818
```
1919

2020
Now you can happily log anything you'd like, and they will show up on

appengine/php72/logging/index.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@
1818

1919
use Google\Cloud\Logging\LoggingClient;
2020

21-
// Create the logging client
22-
$logging = new LoggingClient();
23-
2421
// Create a PSR-3-Compatible logger
25-
$logger = $logging->psrLogger('app', ['batchEnabled' => true]);
22+
$logger = LoggingClient::psrBatchLogger('app');
2623

2724
// Log messages with varying log levels.
2825
$logger->info('This will show up as log level INFO');

0 commit comments

Comments
 (0)