superchairon/ laravel-google-cloud-logging
为Laravel提供的Google Cloud Logging系统
1.0.1
2019-09-05 23:58 UTC
Requires
- google/cloud-error-reporting: ^0.15.0
- google/cloud-logging: ^1.18
This package is auto-updated.
Last update: 2024-09-06 10:38:00 UTC
README
Laravel的Google Cloud Storage文件系统。
此包是Google Cloud Platform Stackdriver的日志记录和错误报告驱动程序。
安装
composer require superchairon/laravel-google-cloud-logging
在您的logging.php
配置文件中添加新的驱动程序
'stackdriver' => [ 'driver' => 'custom', 'via' => \SuperChairon\LaravelGoogleCloudLogging\StackdriverDriver::class, 'logName' => 'my-application-log', 'labels' => [ 'application' => env('APP_NAME'), 'environment' => env('APP_ENV'), 'other labels' => '...', ], 'level' => 'debug', ]
身份验证
Google客户端使用几种方法来确定它应该如何与Google API进行身份验证。
如果设置了环境变量GOOGLE_CLOUD_PROJECT
和GOOGLE_APPLICATION_CREDENTIALS
,它将使用这些变量。
putenv('GOOGLE_CLOUD_PROJECT=project-id'); putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json');
在运行于如Google Compute Engine、Google App Engine和Google Kubernetes Engine等Google Cloud Platform环境时,不需要额外的工作。项目ID和凭证会自动发现。代码应该像已经进行了身份验证一样编写。
更多信息请访问PHP Google Cloud客户端库的身份验证文档