Download the PHP package beyounglabs/monolog-stackdriver without Composer

On this page you can find all versions of the php package beyounglabs/monolog-stackdriver. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package monolog-stackdriver

MonologStackdriver

This package enables you to push your Monolog log entries to Stackdriver which is part of the Google Cloud Platform.

The supplied StackdriverHandler copies the given log level into the Stackdriver's severity based on your log method.

It also respects the context argument which allows you to send extra contextual data with your log message. This will be stored in the log message under jsonPayload.data.


Configuration

Service account

With our samples we assume you have a service account Google Developers Console JSON key file available within your project to point at with read rights.

If you don't have this file yet, you can create it via Google Cloud Platform - IAM & Admin - Service accounts. Please make sure you have at least the role of Logs writer enabled.

Google\Cloud\Logging\LoggingClient options

Please read the documentation for the Google\Cloud\Logging\LoggingClient for other authentication options and further specific connection and setup.

Google\Cloud\Logging\Logger options

Please read the documentation for the Google\Cloud\Logging\Logger setup via Google\Cloud\Logging\LoggingClient for specific details about these options.

This set of options will allow you to set the default resource type and it's related labels that apply to all the logs. Please read Method: monitoredResourceDescriptors.list and do the "Try this API" to get a full list of the specific labels per resource.

Google\Cloud\Logging\Entry options

Please read the documentation for the Google\Cloud\Logging\Entry setup via Google\Cloud\Logging\Logger for specific details about these options.

By default, you can add Stackdriver specific log entry options by adding these wrapped in the stackdriver-key inside the context array. Very useful to add log entry specific labels for instance.

If you need to, you can override this key name by setting $entryOptionsWrapper to your own value (string) when using StackdriverHandler::__construct.

It is also possible to set path to credentials and project id via the global constant.

Pick your framework for some specific setup

Vanilla usage


All versions of monolog-stackdriver with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
monolog/monolog Version ^2.0
google/cloud-logging Version ^1.18
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package beyounglabs/monolog-stackdriver contains the following files

Loading the files please wait ....