PHPackages                             assimtech/dislog-bundle - 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. [Framework](/categories/framework)
4. /
5. assimtech/dislog-bundle

ActiveLibrary[Framework](/categories/framework)

assimtech/dislog-bundle
=======================

Dislog symfony bundle

3.2.3(3y ago)02.8k↓50%MITPHPPHP ^7.2.5|^8

Since Jul 27Pushed 3y ago1 watchersCompare

[ Source](https://github.com/assimtech/dislog-bundle)[ Packagist](https://packagist.org/packages/assimtech/dislog-bundle)[ Docs](https://github.com/assimtech/dislog-bundle)[ RSS](/packages/assimtech-dislog-bundle/feed)WikiDiscussions master Synced 1mo ago

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

DislogBundle
============

[](#dislogbundle)

[![Latest Stable Version](https://camo.githubusercontent.com/7e4f8574b581595e724d3f5ab8d7a5d7a0c179c9a6b25bda27ff9ece7b01bd3d/68747470733a2f2f706f7365722e707567782e6f72672f617373696d746563682f6469736c6f672d62756e646c652f762f737461626c65)](https://packagist.org/packages/assimtech/dislog-bundle)[![Total Downloads](https://camo.githubusercontent.com/4af7f0cb7107a5fbfef5d7780d18e2056b439c8441ced15e09239e0ab42cbe36/68747470733a2f2f706f7365722e707567782e6f72672f617373696d746563682f6469736c6f672d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/assimtech/dislog-bundle)[![Latest Unstable Version](https://camo.githubusercontent.com/01c4462a1054d2af69f5b30248ed9bf7693e21dba2452e11e0df590d73e01d33/68747470733a2f2f706f7365722e707567782e6f72672f617373696d746563682f6469736c6f672d62756e646c652f762f756e737461626c65)](https://packagist.org/packages/assimtech/dislog-bundle)[![License](https://camo.githubusercontent.com/c2bc14554da2ea3617adf45923b7318b64e8eecd51422fba02095f09fd196a83/68747470733a2f2f706f7365722e707567782e6f72672f617373696d746563682f6469736c6f672d62756e646c652f6c6963656e7365)](https://packagist.org/packages/assimtech/dislog-bundle)[![Build Status](https://camo.githubusercontent.com/970f3f1898ece82a0d97a780012d04bb719e494370c9898a53a395b422626d33/68747470733a2f2f7472617669732d63692e6f72672f617373696d746563682f6469736c6f672d62756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/assimtech/dislog-bundle)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/ca63be24cea2495b7f58fc4676004fdc29ac54c431afc1c92cd835f2d7bcd322/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f617373696d746563682f6469736c6f672d62756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/assimtech/dislog-bundle/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/67c9dee720ae523aa05c6b83c3d9549d6b11190b1e41ff17a48bb6e0325eb0ad/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f617373696d746563682f6469736c6f672d62756e646c652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/assimtech/dislog-bundle/?branch=master)

Dislog Bundle provides symfony ^3|^4|^5 integration for [assimtech/dislog](https://github.com/assimtech/dislog), an API Call logger.

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

[](#installation)

Install with composer:

```
composer require assimtech/dislog-bundle
```

Enable the bundle `Assimtech\DislogBundle\AssimtechDislogBundle`.

Configure the [handler](#handler-configuration):

```
assimtech_dislog:
    handler:
        stream:
            resource: '/tmp/my.log'
```

Start logging your api calls:

```
$request = '';

/** @var \Assimtech\Dislog\ApiCallLoggerInterface $apiCallLogger */
$apiCall = $apiCallLogger->logRequest($request, $endpoint, $appMethod, $reference);

$response = $api->transmit($request);

$this->apiCallLogger->logResponse($apiCall, $response);
```

See [assimtech/dislog](https://github.com/assimtech/dislog) for more advanced usage.

Remove old api calls:

```
bin/console assimtech:dislog:remove
```

To log HTTP requests from a PSR-18 client, you may use the service `assimtech_dislog.logging_http_client`:

```
/**
 * @var \Psr\Http\Message\RequestInterface $request
 * @var \Assimtech\Dislog\LoggingHttpClientInterface $httpClient
 * @var \Psr\Http\Message\ResponseInterface $response
 */
$response = $httpClient->sendRequest(
    $request,
    $appMethod,
    $reference,
    $requestProcessors,
    $responseProcessors,
    $deferredLogging
);
```

Handler configuration
---------------------

[](#handler-configuration)

### Doctrine Object Managers

[](#doctrine-object-managers)

The doctrine mapping definitions included with the bundle are placed in non-default paths intentionally to prevent automapping from accidently loading into the wrong object manager.

E.g. If you have an application which uses both `Doctrine\ORM` (for your normal application entities) as well as `Doctrine\ODM` (for Dislog) we don't want `Doctrine\ORM` to detect and load the mapping information from `DislogBundle`'s `ApiCall.orm.xml`. If it did, you may end up with a table being created if you also use `doctrine:schema:update` or Doctrine Migrations.

This means mapping information for Dislog must be loaded manually.

**WARNING: It is advisable to avoid using your application's default entity manager as a `flush()` from dislog may interfere with your application**

#### Doctrine ODM

[](#doctrine-odm)

An example of adding the mapping information with DoctrineMongoDBBundle

```
doctrine_mongodb:
    document_managers:
        default:
            # Your main application document manager config
        dislog:
            connection: default
            mappings:
                AssimtechDislogBundle:
                    type: xml
                    prefix: Assimtech\Dislog\Model
                    dir: Resources/config/doctrine/mongodb

assimtech_dislog:
    handler:
        doctrine_document_manager:
            document_manager: doctrine_mongodb.odm.dislog_document_manager
```

For more advanced setups please see [DoctrineMongoDBBundle Configuration](http://symfony.com/doc/current/bundles/DoctrineMongoDBBundle/config.html)

#### Doctrine ORM

[](#doctrine-orm)

An example of adding the mapping information with DoctrineBundle

```
doctrine:
    orm:
        entity_managers:
            default:
                # Your main application entity manager config
            dislog:
                connection: default
                mappings:
                    AssimtechDislogBundle:
                        type: xml
                        prefix: Assimtech\Dislog\Model
                        dir: Resources/config/doctrine/orm

assimtech_dislog:
    handler:
        doctrine_entity_manager:
            entity_manager: doctrine.orm.dislog_entity_manager
```

For more advanced setups please see [DoctrineBundle Configuration](http://symfony.com/doc/master/bundles/DoctrineBundle/configuration.html)

### Service

[](#service)

You may use your own logger service which implements `Assimtech\Dislog\ApiCallLoggerInterface`.

```
assimtech_dislog:
    handler:
        service:
            name: App\Dislog\ApiLogger
```

**Note:** You are responsible for passing request / response through any processors before persisting. The easiest way to implement a custom logger is to extend the default one.

```
namespace App\Dislog;

use Assimtech\Dislog\Model\ApiCallInterface;
use Assimtech\Dislog\ApiCallLogger;

class ApiLogger extends ApiCallLogger
{
    public function logRequest(
        ?string $request,
        ?string $endpoint,
        ?string $appMethod,
        string $reference = null,
        /* callable[]|callable */ $processors = []
    ): ApiCallInterface {
        $processedRequest = $this->processPayload($processors, $request);

        $apiCall = $this->apiCallFactory->create();
        $apiCall
            ->setRequest($processedRequest)
            ->setEndpoint($endpoint)
            ->setMethod($appMethod)
            ->setReference($reference)
            ->setRequestTime(microtime(true))
        ;

        // Persist $apiCall somewhere

        return $apiCall;
    }

    public function logResponse(
        ApiCallInterface $apiCall,
        string $response = null,
        /* callable[]|callable */ $processors = []
    ): void {
        $duration = microtime(true) - $apiCall->getRequestTime();

        $processedResponse = $this->processPayload($processors, $response);

        $apiCall
            ->setResponse($processedResponse)
            ->setDuration($duration)
        ;

        // Update the persisted $apiCall
    }
}
```

### Stream

[](#stream)

```
assimtech_dislog:
    handler:
        stream:
            identity_generator: Assimtech\Dislog\Identity\UniqueIdGenerator
            resource: /tmp/dis.log
            serializer: Assimtech\Dislog\Serializer\StringSerializer
```

Configuration reference
-----------------------

[](#configuration-reference)

```
assimtech_dislog:
    api_call_factory: assimtech_dislog.api_call.factory # Api Call Factory service name

    max_age: 2592000 # seconds to keep logs for

    handler:
        # *One* of the following sections must be configured, none are enable by default

        doctrine_document_manager:
            document_manager: ~ # document manager service name

        doctrine_entity_manager:
            entity_manager: ~ # entity manager service name

        service:
            name: ~ # Your custom handler service name

        stream:
            resource: ~ # Either a stream path ("/tmp/my.log", "php://stdout") or a stream resource (see fopen)
            identity_generator: Assimtech\Dislog\Identity\UniqueIdGenerator # Identity Generator service name
            serializer: Assimtech\Dislog\Serializer\StringSerializer # Serializer service name

    preferences:
        suppress_handler_exceptions: false # By default, api call logging exceptions are suppressed (they still get emitted as warnings to the psr_logger if any)
        endpoint_max_length: null # By default, limits endpoint max length. Recommended 255 if using a VARCHAR 255 in the storage layer
        method_max_length: null # By default, limits endpoint max length. Recommended 255 if using a VARCHAR 255 in the storage layer
        reference_max_length: null # By default, limits endpoint max length. Recommended 255 if using a VARCHAR 255 in the storage layer

    psr_logger: logger # (Optional) Psr-3 logger service name
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity69

Established project with proven stability

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 ~91 days

Recently: every ~84 days

Total

29

Last Release

1386d ago

Major Versions

1.0.5 → 2.0.02018-05-18

2.1.6 → 3.0.02020-12-24

PHP version history (5 changes)1.0.0PHP &gt;=5.3.3

1.0.2PHP &gt;=5.5.9

2.0.0PHP ^7.1.3

2.1.0PHP ^7.2.5

3.1.0PHP ^7.2.5|^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/44b37dfa4c70338da1f28fe48badad8d80cb0629e3dff8e7b758236ad942a27d?d=identicon)[kralos](/maintainers/kralos)

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/assimtech-dislog-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/assimtech-dislog-bundle/health.svg)](https://phpackages.com/packages/assimtech-dislog-bundle)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.7k509.9M17.0k](/packages/laravel-framework)[livewire/livewire

A front-end framework for Laravel.

23.5k75.5M1.8k](/packages/livewire-livewire)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[laravel/browser-kit-testing

Provides backwards compatibility for BrowserKit testing in the latest Laravel release.

5139.4M286](/packages/laravel-browser-kit-testing)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19562.3M1.3k](/packages/drupal-core)

PHPackages © 2026

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