PHPackages                             linkprofit-cpa/kibana-formatter - 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. linkprofit-cpa/kibana-formatter

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

linkprofit-cpa/kibana-formatter
===============================

Formatter for Kibana log-messages

0.4.2(7y ago)0352[2 PRs](https://github.com/linkprofit-cpa/kibana-formatter/pulls)MITPHPPHP &gt;=7.2.0

Since Feb 26Pushed 5y ago2 watchersCompare

[ Source](https://github.com/linkprofit-cpa/kibana-formatter)[ Packagist](https://packagist.org/packages/linkprofit-cpa/kibana-formatter)[ Docs](https://github.com/linkprofit-cpa/kibana-formatter)[ RSS](/packages/linkprofit-cpa-kibana-formatter/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (4)Versions (11)Used By (0)

kibana-formatter
================

[](#kibana-formatter)

[![Latest Stable Version](https://camo.githubusercontent.com/3507c5fcfecaa88c3d4f129c0fb6b9ed73ec03335d9bff62a9be5b78564454ba/68747470733a2f2f706f7365722e707567782e6f72672f6c696e6b70726f6669742d6370612f6b6962616e612d666f726d61747465722f762f737461626c65)](https://poser.pugx.org/linkprofit-cpa/kibana-formatter/v/stable)[![License](https://camo.githubusercontent.com/25cb80fda0da225c39122511b6b0d9171a02c5786d338c6b2daa11d8bb27345e/68747470733a2f2f706f7365722e707567782e6f72672f6c696e6b70726f6669742d6370612f6b6962616e612d666f726d61747465722f6c6963656e7365)](https://packagist.org/packages/linkprofit-cpa/kibana-formatter)[![Conventional Commits](https://camo.githubusercontent.com/90d8aeee02dec6f5ceeb0423b9ba1aea93519cadbfcb13d62770ac6550780d6e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6e76656e74696f6e616c253230436f6d6d6974732d312e302e302d79656c6c6f772e737667)](https://conventionalcommits.org)[![Semantic Versioning](https://camo.githubusercontent.com/e85a48218ed6fed6b3b6c2c74d8d937a018bd8dfd352ee4d665a18aa0a040f0f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53656d616e74696325323056657273696f6e696e672d322e302e302d627269676874677265656e2e737667)](https://semver.org)

Kibana log-messages for exceptions
----------------------------------

[](#kibana-log-messages-for-exceptions)

By default after formatting in [GelfMessageFormatter](https://github.com/Seldaek/monolog/blob/master/src/Monolog/Formatter/GelfMessageFormatter.php) Exception traces in Kibana JSON-view looks like string. This package formats traces into easy readable JSON.

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

[](#installation)

1. Install kibana-formatter:

    ```
    composer require linkprofit-cpa/kibana-formatter:^0.4
    ```
2. Define environment variables:

    - `APPLICATION_CODE`
    - `APPLICATION_VERSION`
    - `KIBANA_HOST`
    - `KIBANA_PORT`
3. Use this snippet for `Logger` initialization:

    ```
    $connect = new GelfHandler(
       new Publisher(
           new UdpTransport(
               getenv('KIBANA_HOST'),
               getenv('KIBANA_PORT')
           ),
           new KibanaMessageValidator
       )
    );

    $connect->pushProcessor(new PsrLogMessageProcessor);
    $connect->setFormatter(
        new KibanaMessageFormatter(
            new KibanaMessage(
                getenv('APPLICATION_CODE'),
                getenv('APPLICATION_VERSION')
            )
        )
    );

    $logger = new Logger('app', [$connect]);
    ```

Symfony 4+ installation
-----------------------

[](#symfony-4-installation)

1. Install logger: ```
    composer require logger
    ```
2. Install kibana-formatter: ```
    composer require linkprofit-cpa/kibana-formatter:^0.4
    ```
3. Add to `.env.dist` and `.env` `APPLICATION_CODE` and `APPLICATION_VERSION` variables.
4. Edit `config/packages/prod/monolog.yaml`: ```
    monolog:
        handlers:
            graylog:
                type: gelf
                publisher:
                    id: gelf.kibana.publisher
                level: notice
                bubble: true
                formatter: Linkprofit\KibanaFormatter\KibanaMessageFormatter
    ```

    Recommended log level for *prod* and *test* environments - **notice**. For *dev* - **debug**.
5. Edit `config/services.yaml`: ```
    services:
        ...
        Linkprofit\KibanaFormatter\KibanaMessage:
            arguments:
                - '%env(APPLICATION_CODE)%'
                - '%env(APPLICATION_VERSION)%'

        Linkprofit\KibanaFormatter\KibanaMessageValidator:

        Linkprofit\KibanaFormatter\KibanaMessageFormatter:
            class: Linkprofit\KibanaFormatter\KibanaMessageFormatter
            arguments:
                - '@Linkprofit\KibanaFormatter\KibanaMessage'

        gelf.kibana.publisher:
            class: Gelf\Publisher
            arguments:
                - '@gelf.kibana.transport'
                - '@Linkprofit\KibanaFormatter\KibanaMessageValidator'

        gelf.kibana.transport:
            class: Gelf\Transport\UdpTransport
            arguments: [elastic.lthost.net, 12201, 1420]
    ```

Versioning
----------

[](#versioning)

This software follows *"Semantic Versioning"* specifications. All function signatures declared as public API.

Read more on [SemVer.org](http://semver.org).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92% 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

Every ~1 days

Total

8

Last Release

2623d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c171f2966ae0908bc06e7a1cb586483a65edc32f38c7db26ee7cd663fad01d87?d=identicon)[nafigat0r](/maintainers/nafigat0r)

![](https://www.gravatar.com/avatar/2bea1b84b4d10cc72a6fca3c5bff2e8f95f263a9f75f4e4221860c4c44827926?d=identicon)[linkprofit-cpa](/maintainers/linkprofit-cpa)

---

Top Contributors

[![nafigator](https://avatars.githubusercontent.com/u/1971423?v=4)](https://github.com/nafigator "nafigator (23 commits)")[![Phrlog](https://avatars.githubusercontent.com/u/9060150?v=4)](https://github.com/Phrlog "Phrlog (2 commits)")

---

Tags

formattergelflogstashkibana

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/linkprofit-cpa-kibana-formatter/health.svg)

```
[![Health](https://phpackages.com/badges/linkprofit-cpa-kibana-formatter/health.svg)](https://phpackages.com/packages/linkprofit-cpa-kibana-formatter)
```

###  Alternatives

[hedii/laravel-gelf-logger

A Laravel package to send logs to a gelf compatible backend like graylog

1333.4M10](/packages/hedii-laravel-gelf-logger)[nulpunkt/monolog-elasticsearch-logstashformat

Use the logstash formatter with elasticsearch

3570.1k](/packages/nulpunkt-monolog-elasticsearch-logstashformat)

PHPackages © 2026

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