google / cloud-logging
Stackdriver Logging Client for PHP
Requires
- php: ^8.0
- google/cloud-core: ^1.58
- google/gax: ^1.34.0
Requires (Dev)
- erusev/parsedown: ^1.6
- fig/log-test: ^1.1
- google/cloud-bigquery: ^1.0
- google/cloud-pubsub: ^2.0
- google/cloud-storage: ^1.3
- monolog/monolog: 3.7.0
- opis/closure: ^3
- phpdocumentor/reflection: ^5.3.3
- phpdocumentor/reflection-docblock: ^5.3
- phpspec/prophecy-phpunit: ^2.0
- phpunit/phpunit: ^9.0
- squizlabs/php_codesniffer: 2.*
Suggests
- ext-grpc: The gRPC extension enables use of the performant gRPC transport
- ext-protobuf: Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions.
- psr/log: For using the PSR logger. Currently supports versions 1 and 2.
Provides
- psr/log-implementation: 2.0||3.0
- dev-main
- v1.31.1
- v1.31.0
- v1.30.3
- v1.30.2
- v1.30.1
- v1.30.0
- v1.29.4
- v1.29.3
- v1.29.2
- v1.29.1
- v1.29.0
- v1.28.5
- v1.28.4
- v1.28.3
- v1.28.2
- v1.28.1
- v1.28.0
- v1.27.1
- v1.27.0
- v1.26.0
- v1.25.5
- v1.25.4
- v1.25.3
- v1.25.2
- v1.25.1
- v1.25.0
- v1.24.10
- v1.24.9
- v1.24.8
- v1.24.7
- v1.24.6
- v1.24.5
- v1.24.4
- v1.24.3
- v1.24.2
- v1.24.1
- v1.24.0
- v1.23.0
- v1.22.3
- v1.22.2
- v1.22.1
- v1.22.0
- v1.21.1
- v1.21.0
- v1.20.1
- v1.20.0
- v1.19.1
- v1.19.0
- v1.18.0
- v1.17.0
- v1.16.5
- v1.16.4
- v1.16.3
- v1.16.2
- v1.16.1
- v1.16.0
- v1.15.0
- v1.14.5
- v1.14.4
- v1.14.3
- v1.14.2
- v1.14.1
- v1.14.0
- v1.13.0
- v1.12.9
- v1.12.8
- v1.12.7
- v1.12.6
- v1.12.5
- v1.12.4
- v1.12.3
- v1.12.2
- v1.12.1
- v1.12.0
- v1.11.1
- v1.11.0
- v1.10.5
- v1.10.4
- v1.10.3
- v1.10.2
- v1.10.1
- v1.10.0
- v1.9.4
- v1.9.3
- v1.9.2
- v1.9.1
- v1.9.0
- v1.8.3
- v1.8.2
- v1.8.1
- v1.8.0
- v1.7.0
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.0
- v1.4.0
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.0
- v1.1.0
- v1.0.0
- v0.1.0
- dev-policy-bot-8ac689b6-9ca6-44ac-ae26-42047273a6c5
- dev-policy-bot-552f414f-224f-4fe9-9d18-fffa83274076
This package is auto-updated.
Last update: 2024-11-06 21:56:36 UTC
README
Idiomatic PHP client for Stackdriver Logging.
NOTE: This repository is part of Google Cloud PHP. Any support requests, bug reports, or development contributions should be directed to that project.
Allows you to store, search, analyze, monitor, and alert on log data and events from Google Cloud Platform and Amazon Web Services.
Installation
To begin, install the preferred dependency manager for PHP, Composer.
Now install this component:
$ composer require google/cloud-logging
This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits offered by gRPC (such as streaming methods) please see our gRPC installation guide.
Authentication
Please see our Authentication guide for more information on authenticating your client. Once authenticated, you'll be ready to start making requests.
Sample
require 'vendor/autoload.php'; use Google\Cloud\Logging\LoggingClient; $logging = new LoggingClient(); // Get a logger instance. $logger = $logging->logger('my_log'); // Write a log entry. $logger->write('my message'); // List log entries from a specific log. $entries = $logging->entries([ 'filter' => 'logName = projects/my_project/logs/my_log' ]); foreach ($entries as $entry) { echo $entry->info()['textPayload'] . "\n"; }
Version
This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in any minor or patch releases. We will address issues and requests with the highest priority.
Next Steps
- Understand the official documentation.
- Take a look at in-depth usage samples.