PHPackages                             swisnl/laravel-graylog2 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. swisnl/laravel-graylog2

AbandonedArchivedLibrary[Logging &amp; Monitoring](/categories/logging)

swisnl/laravel-graylog2
=======================

Log your Laravel application errors to Graylog2

0.7.0(7y ago)2023.6k6[1 PRs](https://github.com/swisnl/laravel-graylog2/pulls)MITPHPPHP &gt;=5.6.0

Since Sep 5Pushed 4y ago2 watchersCompare

[ Source](https://github.com/swisnl/laravel-graylog2)[ Packagist](https://packagist.org/packages/swisnl/laravel-graylog2)[ RSS](/packages/swisnl-laravel-graylog2/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (7)Versions (12)Used By (0)

Graylog2 Logging for Laravel 5.x
================================

[](#graylog2-logging-for-laravel-5x)

[![License](https://camo.githubusercontent.com/6282a0d5141eb1176a242bb3346595ec673c3f2fd5997eba54faaab67d33e36b/68747470733a2f2f706f7365722e707567782e6f72672f737769736e6c2f74657874736e69707065742f6c6963656e7365)](https://packagist.org/packages/swisnl/laravel-graylog) [![Build Status](https://camo.githubusercontent.com/63bb0d1e6b8769754e75caaebb847476f197167ebd06e28771afe20f2d2d2552/68747470733a2f2f7472617669732d63692e6f72672f737769736e6c2f6c61726176656c2d677261796c6f67322e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/swisnl/laravel-graylog2) [![Made by SWIS](https://camo.githubusercontent.com/8c541545402619860a7346c32a176d63a2b75eb8ebb85590d06a26b62417d260/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2546302539462539412538302d6d6164652532306279253230535749532d2532333037333741392e737667)](https://www.swis.nl)

🚨 **THIS PACKAGE HAS BEEN ABANDONED** 🚨

We don't use this package anymore in our own projects and cannot justify the time needed to maintain it anymore. That's why we have chosen to abandon it. Feel free to fork our code and maintain your own copy or use one of the many alternatives.

Installation
------------

[](#installation)

1. Run composer require for this package: `composer require swisnl/laravel-graylog2`
2. Add the service provider to app.php if you don't like auto discovery: `Swis\Graylog2\Graylog2ServiceProvider`
3. Run `php artisan vendor:publish` to publish the config file to ./config/graylog2.php.
4. Configure it to your liking
5. Done!

Logging exceptions
------------------

[](#logging-exceptions)

The default settings enable logging of exceptions. It will add the HTTP request to the GELF message, but it will not add POST values. Check the graylog2.log-requests config to enable or disable this behavior.

Minimum log level
-----------------

[](#minimum-log-level)

You can adjust the minimum log level by changing the value `log_level`in configuration.

Message Processors
------------------

[](#message-processors)

Processors add extra functionality to the handler. You can register processors by modifying the AppServiceProvider:

```
public function register()
{
    //...
    Graylog2::registerProcessor(new \Swis\Graylog2\Processor\ExceptionProcessor());
    Graylog2::registerProcessor(new \Swis\Graylog2\Processor\RequestProcessor());
    Graylog2::registerProcessor(new MyCustomProcessor());
    //...
}
```

The following processors are available by default:

**ExceptionProcessor**

Adds exception data to the message if there is any.

**RequestProcessor**

Adds the current Laravel Request to the message. It adds the url, method and ip by default.

Custom processors
-----------------

[](#custom-processors)

You can define a custom processor by implementing `Swis\Graylog2\Processor\ProcessorInterface`. The result should look something like this:

```
