PHPackages                             mediasuite/silverstripe-logging-elasticsearch - 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. mediasuite/silverstripe-logging-elasticsearch

AbandonedArchivedLibrary

mediasuite/silverstripe-logging-elasticsearch
=============================================

A modification of monologs public logging handler to allow Elastic Search to work with Silverstripe 4 project and the latest elasticsearch version on the Cloud

02PHP

Since Jul 10Pushed 2y agoCompare

[ Source](https://github.com/mediasuitenz/silverstripe-logging-elasticsearch)[ Packagist](https://packagist.org/packages/mediasuite/silverstripe-logging-elasticsearch)[ RSS](/packages/mediasuite-silverstripe-logging-elasticsearch/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Silverstripe logging Elasticsearch
==================================

[](#silverstripe-logging-elasticsearch)

Out of the box Silverstripe uses a package called monolog as its “ready to go” logging solution. Monolog seems to be ubiquitous for PHP logging in multiple frameworks and is well supported..

You can specify a handler from a folder of handlers that connects to an interface for a wide range of logging approaches into a Slack channel, Stream into a logging file (most common approach), write to DB etc.

One of these handlers is designed for ElasticSearch. However due to SS4 restricting requirement to monolog v1.2.7.1 there are some minor complications.

How it works
------------

[](#how-it-works)

We have the monolog package which is used to bridge the SS specific framework internal errors/logs and converts into the PSR4 compatible standard, then hands this over to a client that handles the request/response to the ElasticSearch cloud instance.

This client is a package named elastica which binds the output of the logging from monolog to a curl request to the cloud instance. Another code base that is very popular in php community. Though seems to be redundant in later versions of monolog.

\*In silverstripe 5 we can use monolog v3.4.1 which handles this all natively with the API provided from ElasticSearch. This will mitigate the need for the custom code described in the solution.

The older releases of elastica are not compatible with the Cloud ES api. However upgrading elastica then creates issues with the older version monolog v1.2.1.7 codebase.

Most notably the “code formatter” references methods that are now deprecated and removed from the elastica codebase.

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

[](#installation)

composer require mediasuite/silverstripe-logging-elasticsearch

Add the following code snippit to your \_config.php with the 3 ENV varaibles set in your .env based on your ES cloud instance config

app/\_config.php

```

$logger = Injector::inst()->get(LoggerInterface::class);
if ($logger instanceof Logger
    && Environment::getEnv('ELASTIC_SEARCH_INDEX')
    && Environment::getEnv('ELASTIC_SEARCH_HOST')
    && Environment::getEnv('ELASTIC_SEARCH_APIKEY')) {
    $options = array(
        'index' => Environment::getEnv('ELASTIC_SEARCH_INDEX')      // Elastic index name
    );
    $config = [
        'connections' => [
            [   'host' => Environment::getEnv('ELASTIC_SEARCH_HOST'),
                'port' => 443,
                'transport' => 'Https',
                'headers' => [
                'Authorization' => 'ApiKey' . Environment::getEnv('ELASTIC_SEARCH_APIKEY')
                ]
            ]
        ]
    ];
    $client = new Client($config);
    $handler = new CustomESHandler($client, $options);
    $logger->pushHandler($handler);
}

```

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![bobbyjm23](https://avatars.githubusercontent.com/u/53022180?v=4)](https://github.com/bobbyjm23 "bobbyjm23 (3 commits)")

### Embed Badge

![Health badge](/badges/mediasuite-silverstripe-logging-elasticsearch/health.svg)

```
[![Health](https://phpackages.com/badges/mediasuite-silverstripe-logging-elasticsearch/health.svg)](https://phpackages.com/packages/mediasuite-silverstripe-logging-elasticsearch)
```

PHPackages © 2026

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