Download the PHP package rcrowe/raven without Composer
On this page you can find all versions of the php package rcrowe/raven. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package raven
Short Description Raven client for Sentry that supports background processing through multiple providers.
License
Homepage https://github.com/rcrowe/Raven
Informations about the package raven
Raven
Raven is a client for recording and transmitting messages to Sentry.
Its special sauce is that it can transmit those messages to Sentry in the background. No more slow down while a HTTP request is made!
Raven offers flexibility in how those messages are captured, processed & sent. But also offers quick seemless intergration into a range of frameworks, such as:
Installation
Add rcrowe\raven
as a requirement to composer.json:
Update your packages with composer update
or install with composer install
.
Then follow the instructions for your provider (if you are using one).
Usage
This library exposes the same API for recording your messages as the official raven-php client. It should just be a case of
replacing Raven_Client
with rcrowe\Raven\Client
. For usage of recording messages checkout out raven-php.
To record a message and transmit it to Sentry straight away (the default):
Handlers
Handlers are responsible for taking a new captured message and putting into a background queue. If no handler is registered with the raven client the message is transmitted straight away.
A handler can be added to the client as follows:
Sync Handler
(Default) Like raven-php new messages are transmitted straight away.
Laravel Handler
If using within a Laravel project, makes use of the illuminate\queue
API. For improved Laravel intergration checkout the Laravel provider below.
Transports
Transports are responsible for sending the message to the Sentry API. Transports are always the first parameter passed into a handler. If no transport is provided it will default to HTTP.
Dummy
Dummy transport does absolutely nothing. Nothing is transmitted to the API. You may not want to transmit any messages when working in a dev environment.
HTTP
(Default) Transmit the message over HTTP. To do this we make use of the great HTTP client Guzzle.
As this is the default transport mechanism there is no need to pass it into the handler. The above call is the same as:
Providers
Providers offer painless integration to other libraries / frameworks.
Laravel
Installation
Add the service provider to app/config/app.php
:
Optionally register the facade to your aliases:
Configuration
Raven needs to know your client DSN. First publish the Raven config file with the following command:
Then edit app/config/packages/rcrowe/raven/config.php
You can also set your Raven DSN from app/config/services.php
:
Note: Raven makes use of the Laravel queue, so make sure your app/config/queue.php
is set correctly.
Usage
Now where ever you want to record a message just use the normal Log facade.
To capture and send all messages you can add the following:
Note: Be aware that Laravel does this out of the box in app/start/global.php
Using the alias you can set / remove the user information for all messages:
Note: Check out the config file for more!