PHPackages                             ubatgroup/graylog - 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. ubatgroup/graylog

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

ubatgroup/graylog
=================

A package to send logs to graylog

1.0(8y ago)0401MITPHPPHP &gt;=7.0

Since Mar 16Pushed 8y agoCompare

[ Source](https://github.com/ubatgroup/graylog)[ Packagist](https://packagist.org/packages/ubatgroup/graylog)[ RSS](/packages/ubatgroup-graylog/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Laravel wrapper for UbatGroup Graylog Server
============================================

[](#laravel-wrapper-for-ubatgroup-graylog-server)

It is a laravel wrapper for [bzikarsky/gelf-php](https://github.com/bzikarsky/gelf-php) package.

This package was developed for an internal need. No maintenance's planned.

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

[](#installation)

Install via [composer](https://getcomposer.org/doc/00-intro.md)

```
composer require ubatgroup/graylog
```

### Only for Laravel 5 to 5.3

[](#only-for-laravel-5-to-53)

Add it to your providers array in `config/app.php`:

```
Ubatgroup\Graylog\GraylogServiceProvider::class
```

To use the facade, add it to your aliases array in `config/app.php`:

```
'Graylog' => Ubatgroup\Graylog\Facades\Graylog::class
```

### For Laravel 5.4 and more

[](#for-laravel-54-and-more)

Laravel auto discover new packages

```
composer dump-autoload
```

### Configuration

[](#configuration)

Set the graylog configuration into the .env file :

- **GRAYLOG\_SERVER** : server graylog ip (if this key is not set, it uses 127.0.0.1)
- **GRAYLOG\_PORT** : server graylog port (if this key is not set, it uses 12201)
- **GRAYLOG\_FACILITY** : graylog facility filter (if this key is not set, it uses **APP\_URL** key)
- **GRAYLOG\_APPNAME** : graylog source filter (if this key is not set, it uses **APP\_NAME** key)

##### To override the configuration file :

[](#to-override-the-configuration-file-)

First, publish the configuration file:

```
php artisan vendor:publish --provider="Ubatgroup\Graylog\GraylogServiceProvider"
```

See the content of the published configuration file in `config/graylog.php`.

```
// Address serveur host
'server'   => env( 'GRAYLOG_SERVER', '127.0.0.1' ),

// Port server host
'port'     => env( 'GRAYLOG_PORT', 12201 ),

// facility to filter logs (common use application URL)
'facility' => env( 'GRAYLOG_FACILITY', env( 'APP_URL', null ) ),

// host to filter logs (common use application name)
'host'     => env( 'GRAYLOG_HOST', env( 'APP_NAME', null ) ),

// Add Auth::user data automatically as AdditionaData in every exception handle by the connected user
'auto_log_auth_user' => true,
```

Usage
-----

[](#usage)

```
 Graylog::emergency( $message, array $context = array() );
 Graylog::alert( $message, array $context = array() );
 Graylog::critical( $message, array $context = array() );
 Graylog::error( $message, array $context = array() );
 Graylog::warning( $message, array $context = array() );
 Graylog::notice( $message, array $context = array() );
 Graylog::info( $message, array $context = array() );
 Graylog::debug( $message, array $context = array() );
```

See the [bzikarsky/gelf-php](https://github.com/bzikarsky/gelf-php/tree/master/examples) examples in his repo to find the available methods for the `Graylog` facade.

### Example

[](#example)

```
Graylog::alert('There was a foo in bar', [
    'foo' => 'bar',
    'other_context_key' => 'other_context_value',
]);
```

```
try {
    throw new \Exception('Nice exception !');
} catch (\Exception $e) {
    Graylog::emergency('Exception handled !', [
        'exception' => $e,
        'additionnal_data' => 'Hello world!
    ]);
}
```

Note
----

[](#note)

- If **auto\_log\_auth\_user** config key and **Auth::check()** are **true**, **Auth::user()** data are auto added to the context array (auth\_user key)
- If you need to use **$guard** to get the authenticated user, turn **false** the **auto\_log\_auth\_user** config key and add it manually in additionnal data array
- Don't use special/accentuated chars in context key for additionals data

License
-------

[](#license)

This package is released under the MIT Licence.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3028d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/37403551?v=4)[JulienMoulinUbat](/maintainers/JulienMoulinUbat)[@JulienMoulinUbat](https://github.com/JulienMoulinUbat)

---

Top Contributors

[![JulienMoulinUbat](https://avatars.githubusercontent.com/u/37403551?v=4)](https://github.com/JulienMoulinUbat "JulienMoulinUbat (10 commits)")

### Embed Badge

![Health badge](/badges/ubatgroup-graylog/health.svg)

```
[![Health](https://phpackages.com/badges/ubatgroup-graylog/health.svg)](https://phpackages.com/packages/ubatgroup-graylog)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

87411.3M154](/packages/spatie-laravel-health)[illuminate/log

The Illuminate Log package.

6225.0M603](/packages/illuminate-log)[spatie/laravel-flare

Send Laravel errors to Flare

111.2M6](/packages/spatie-laravel-flare)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
