Download the PHP package spiria-digital/laravel-statsd without Composer
On this page you can find all versions of the php package spiria-digital/laravel-statsd. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download spiria-digital/laravel-statsd
More information about spiria-digital/laravel-statsd
Files in spiria-digital/laravel-statsd
Package laravel-statsd
Short Description Send to Statsd server from Laravel
License MIT
Informations about the package laravel-statsd
Allows you to seamlessly send data to a Statsd server from within your Laravel application.
Installation
Add Spiria-Digital\laravel-statsd
package with composer
Update your packages with composer update
or install with composer install
.
Laravel >5.5
Since version 5.5, Laravel support Package Auto-Discovery, which means that Service Provider and aliases can be added automatically through the package composer file. Therefore, once Composer has installed or updated your packages Laravel-Statsd should be registered as a service provider and should provide the Statsd
Facade.
Laravel <5.4
If you are using an older verison of Laravel you must add the provider and the alias manually.
You can register Statsd with Laravel by opening up app/config/app.php and adding the providers key in the providers
array:
You will also need to register the facade so that you can access it within your application. To do this add the following to your aliases
in app/config/app.php:
Configuration
Statsd configuration file can be extended by creating app/config/statsd.php
. You can find the default configuration file under vendor/Spiria-Digital/laravel-statsd/config/config.php
.
You can quickly publish a configuration file by running the following Artisan command.
Usage
Laravel-Statsd exposes the following functions to send data to Statsd:
The data is automatically sent to Statsd at the end of Laravels life-cycle, but you can force data to be sent with:
Note: Data will only be sent to Statsd if your environment matches the environments defined in the config file.
This package is an updated version of rcrowe/laravel-statsd and has been tested with laravel 5.4+ only. It does not currently support Lumen.