PHPackages                             integration-eye/logging-probe - 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. integration-eye/logging-probe

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

integration-eye/logging-probe
=============================

Integration Eye™ Logging Probe

1.0.0(5y ago)15MITPHPPHP &gt;= 7.1

Since Aug 10Pushed 5y ago1 watchersCompare

[ Source](https://github.com/integration-eye/logging-probe)[ Packagist](https://packagist.org/packages/integration-eye/logging-probe)[ RSS](/packages/integration-eye-logging-probe/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (2)Used By (0)

Integration Eye Logging Probe
=============================

[](#integration-eye-logging-probe)

This library is implementation of [PSR-3 Logger Interface](https://www.php-fig.org/psr/psr-3) sending log messages and exceptions to [Integration Eye](https://integrationeye.com) instance.

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

[](#installation)

This library is available in [Packagist](https://packagist.org/), so you can install it using [Composer](https://getcomposer.org/):

```
composer require integration-eye/logging-probe
```

For usage of this library, you need to provide implementation of `Client` interface. If you install `symfony/http-client` package, default implementation will be provided.

```
composer require symfony/http-client
```

For more information about custom `Client` implementation see [Client](#client).

Simple Usage
------------

[](#simple-usage)

There is `Logger::fromDsn($dsn)` factory function for simple instantiation of `Logger`.

```
$logger = Logger::fromDsn('https://username:password@integrationeye.example.com');
```

Logger implements [PSR-3 Logger Interface](https://www.php-fig.org/psr/psr-3) so you can use is as follows:

```
$logger->debug('Trying out Integration Eye');

$logger->critical(new RuntimeException('Sometimes something goes wrong.'));

$logger->notice('It is shiny today', [
    'temperature' => '28',
    'date' => new DateTime(),
]);
```

You can pass internal flags like `@principal` into context, and it will be used as metadata.

```
$logger->info('User just logged in.', [
    '@principal' => 'username',
    'method' => 'password',
]);
```

For more information about providing `@principal`, see [PrincipalProvider](#principalprovider).

Advanced Usage
--------------

[](#advanced-usage)

Logger is composed of `MessageFactory` instance and `Client` implementation.

Here is an example of creating `Logger` manually without `Logger::fromDsn($dsn)` factory method.

```
$configuration = Configuration::fromDsn('https://username:password@integrationeye.example.com');
$messageFactory = new MessageFactory($configuration);

$client = new DefaultClient();
$logger = new Logger($messageFactory, $client);
```

Extensions
----------

[](#extensions)

### Client

[](#client)

`Client` interface consist of single method `sendMessage(Configuration $configuration, array $payload): void` which purpose is to send POST request to configured endpoint.

Optional default implementation is using `symfony/http-client`, but you can provide your own, if it is not what you need.

Here is a simplified example of existing client for testing purposes.

```
class EchoClient implements Client
{
    public function sendMessage(Configuration $configuration, array $payload): void
    {
        echo sprintf("Url: %s\n", $configuration->getUrl());
        echo sprintf("Authorization: Basic %s\n", $configuration->getBasicAuth());
        echo sprintf("Payload:\n%s\n", json_encode($payload, JSON_PRETTY_PRINT));
    }
}
```

### PrincipalProvider

[](#principalprovider)

To send `@principal` metadata with your logs, you can provide implementation of `PrincipalProvider`. It has single method `getPrincipal(): ?string` which you can override.

Here is an example of custom implementation:

```
class CustomPrincipalProvider implements PrincipalProvider
{
    private $securityContext;

    public function __construct(SecurityContext $securityContext)
    {
        $this->securityContext = $securityContext;
    }

    public function getPrincipal(): ?string
    {
        if ($this->securityContext->isLoggedIn()) {
            return $this->securityContext->getUsername();
        }

        return null;
    }
}

$messageFactory->setPrincipalProvider(new CustomPrincipalProvider($securityContext));
```

If you want, you can use built-in `DefaultPrincipalProvider` for static resolution of principal.

```
$messageFactory->setPrincipalProvider(new DefaultPrincipalProvider('username'));
// or just
$messageFactory->setPrincipal('username');
```

### Mapper

[](#mapper)

You can provide implementations of `Mapper` interface for simplifying your logging. It consists of two methods `supports(string $key, $value): bool` and `map(string $key, $value): array`.

Here is a simplified example of existing mapper for `JsonSerializable` objects:

```
class JsonMapper implements Mapper
{
    public function supports(string $key, $value): bool
    {
        return $value instanceof \JsonSerializable;
    }

    public function map(string $key, $value): array
    {
        return [$key => json_encode($value)];
    }
}

$messageFactory->addMapper(new JsonMapper());
```

This library provides some built-in mappers:

- `DateTimeMapper` for formatting `DateTime` objects
- `JsonMapper` for serializing `JsonSerializable` objects
- `ExceptionMapper` for serializing `Throwable` objects and providing `@exception`, `@stackTrace` metadata

```
$messageFactory->addMapper(new DateTimeMapper('d.m.Y H:i:s'));
// or just
$messageFactory->addDateTimeMapper(); // default format 'c'

$messageFactory->addMapper(new JsonMapper());
// or just
$messageFactory->addJsonMapper();

$messageFactory->addMapper(new ExceptionMapper('exception_key'));
// or just
$messageFactory->addExceptionMapper(); // default key 'exception'
```

When you use `Logger::fromDsn($dsn)` or `MessageFactory::instance($configuration)`, all built-in mappers will be automatically registered with their default configuration.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

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

2098d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3584190?v=4)[Lukáš Moravec](/maintainers/morki)[@morki](https://github.com/morki)

![](https://www.gravatar.com/avatar/91a053b1ff75ff8a00469f14ea9a39ab8e978cb6ea734a60d0d1ee961351f532?d=identicon)[tjurak](/maintainers/tjurak)

---

Top Contributors

[![morki](https://avatars.githubusercontent.com/u/3584190?v=4)](https://github.com/morki "morki (1 commits)")

---

Tags

apilogloggerloggingservices

### Embed Badge

![Health badge](/badges/integration-eye-logging-probe/health.svg)

```
[![Health](https://phpackages.com/badges/integration-eye-logging-probe/health.svg)](https://phpackages.com/packages/integration-eye-logging-probe)
```

###  Alternatives

[sentry/sentry

PHP SDK for Sentry (http://sentry.io)

1.9k227.1M271](/packages/sentry-sentry)[rollbar/rollbar

Monitors errors and exceptions and reports them to Rollbar

33723.7M81](/packages/rollbar-rollbar)[illuminate/log

The Illuminate Log package.

6224.3M517](/packages/illuminate-log)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2222.9M248](/packages/open-telemetry-sdk)[open-telemetry/api

API for OpenTelemetry PHP.

1833.0M214](/packages/open-telemetry-api)[pagemachine/typo3-formlog

Form log for TYPO3

23225.3k6](/packages/pagemachine-typo3-formlog)

PHPackages © 2026

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