There is no license information available for the latest version (0.4.5) of this package.

0.4.5 2017-08-27 13:35 UTC

This package is auto-updated.

Last update: 2024-05-29 03:27:13 UTC


This is a PHP library that is a client for LogStream.

Getting started

This library can be used both as standalone or with the Symfony integration.


use GuzzleHttp\Client;
use LogStream\Client\Http\JsonSerializableNormalizer;
use LogStream\Client\HttpClient;
use LogStream\TreeLoggerFactory;

$loggerFactory = new TreeLoggerFactory(
    new HttpClient(
        new Client(),
        new JsonSerializableNormalizer(),

Symfony integration

The library contains a Symfony bundle. In order to activate it, you simply have to add in in your AppKernel.php file:

$bundles = [
    // ...
    new LogStream\LogStreamBundle(),

Then, simply adds the configuration:


Configuration reference

    # Address of LogStream API

Operation runner

An interesting feature is the integration with the FaultTolerance library: there's a client decorator, OperationRunnerDecorator that accepts an operation runner to run the client's calls. That way you can easily have a retry feature in case of problems in the real-time stream:

use LogStream\Client\FaultTolerance\OperationRunnerDecorator;

use FaultTolerance\OperationRunner\SimpleOperationRunner;
use FaultTolerance\OperationRunner\RetryOperationRunner;
use FaultTolerance\Waiter\SleepWaiter;
use FaultTolerance\WaitStrategy\Exponential;

$runner = new RetryOperationRunner(
    new SimpleOperationRunner(),
    new Max(new Exponential(new SleepWaiter(), 0.1), 10)

$client = new OperationRunnerDecorator($client, $operationRunner);