2017 © Pedro Peláez
 

library cloud-error-reporting

Stackdriver Error Reporting Client for PHP

image

google/cloud-error-reporting

Stackdriver Error Reporting Client for PHP

  • Thursday, July 19, 2018
  • by bshaffer
  • Repository
  • 36 Watchers
  • 1 Stars
  • 12,478 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 32 Versions
  • 60 % Grown

The README.md

Stackdriver Error Reporting for PHP

Idiomatic PHP client for Stackdriver Error Reporting., (*1)

Latest Stable Version Packagist, (*2)

NOTE: This repository is part of Google Cloud PHP. Any support requests, bug reports, or development contributions should be directed to that project., (*3)

Stackdriver Error Reporting counts, analyzes and aggregates the crashes in your running cloud services., (*4)

Installation

To begin, install the preferred dependency manager for PHP, Composer., (*5)

Now install this component:, (*6)

$ composer require google/cloud-error-reporting

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., (*7)

Authentication

Please see our Authentication guide for more information on authenticating your client. Once authenticated, you'll be ready to start making requests., (*8)

Sample

The Stackdriver Error Reporting client provides APIs allowing you to easily configure your application to send errors and exceptions automatically to Stackdriver, or to manually report and manage errors and statistics., (*9)

Reporting errors from your application:

require 'vendor/autoload.php';

use Google\Cloud\ErrorReporting\Bootstrap;
use Google\Cloud\Logging\LoggingClient;
use Google\Cloud\Core\Report\SimpleMetadataProvider;

$projectId = '[PROJECT]';
$service = '[SERVICE_NAME]';
$version = '[APP_VERSION]';

$logging = new LoggingClient();
$metadata = new SimpleMetadataProvider([], $projectId, $service, $version);
$psrLogger = $logging->psrLogger('error-log', [
    'metadataProvider' => $metadata
]);

// Register the logger as a PHP exception and error handler.
// This will begin logging application exceptions and errors to Stackdriver.
Bootstrap::init($psrLogger);

Using the Error Reporting API:

require 'vendor/autoload.php';

use Google\Cloud\ErrorReporting\V1beta1\ReportErrorsServiceClient;
use Google\Cloud\ErrorReporting\V1beta1\ReportedErrorEvent;

$reportErrorsServiceClient = new ReportErrorsServiceClient();
$formattedProjectName = $reportErrorsServiceClient->projectName('[PROJECT]');
$event = new ReportedErrorEvent();

try {
    $response = $reportErrorsServiceClient->reportErrorEvent($formattedProjectName, $event);
} finally {
    $reportErrorsServiceClient->close();
}

Version

This component is considered beta. As such, it should be expected to be mostly stable and we're working towards a release candidate. We will address issues and requests with a higher priority., (*10)

Next Steps

  1. Understand the official documentation.
  2. Take a look at in-depth usage samples.

The Versions

19/07 2018

dev-master

9999999-dev

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

19/07 2018

v0.11.2

0.11.2.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

03/07 2018

v0.11.1

0.11.1.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

12/06 2018

v0.11.0

0.11.0.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

31/05 2018

v0.10.1

0.10.1.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

24/05 2018

v0.10.0

0.10.0.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

08/05 2018
16/04 2018
11/04 2018
03/04 2018
29/03 2018
28/03 2018
16/03 2018

v0.8.4

0.8.4.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

26/02 2018

v0.8.3

0.8.3.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

15/02 2018

v0.8.2

0.8.2.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

01/02 2018

v0.8.1

0.8.1.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

23/01 2018

v0.8.0

0.8.0.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

29/12 2017

v0.7.3

0.7.3.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

22/12 2017

v0.7.2

0.7.2.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

16/12 2017

v0.7.1

0.7.1.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

02/12 2017

v0.7.0

0.7.0.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

15/11 2017

v0.6.1

0.6.1.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

01/11 2017

v0.6.0

0.6.0.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

17/10 2017

v0.5.0

0.5.0.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

05/09 2017

v0.4.3

0.4.3.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

25/08 2017

v0.4.2

0.4.2.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

12/07 2017

v0.4.1

0.4.1.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

01/07 2017

v0.4.0

0.4.0.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

25/05 2017

v0.3.0

0.3.0.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

19/05 2017

v0.2.1

0.2.1.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

18/05 2017

v0.2.0

0.2.0.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires

 

10/03 2017

v0.1.0

0.1.0.0

Stackdriver Error Reporting Client for PHP

  Sources   Download

Apache-2.0

The Requires