2017 © Pedro Peláez
 

symfony-bundle monolog-extra-bundle

Symfony bundle with extra processors and logger to log request/response

image

hexanet/monolog-extra-bundle

Symfony bundle with extra processors and logger to log request/response

  • Friday, April 13, 2018
  • by martin-damien
  • Repository
  • 4 Watchers
  • 2 Stars
  • 8,479 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 11 Versions
  • 13 % Grown

The README.md

MonologExtraBundle

Build Status Total Downloads Latest stable Version, (*1)

Symfony bundle with extra processors and logger to log request/response., (*2)

Installation

Applications that use Symfony Flex

Open a command console, enter your project directory and execute:, (*3)

$ composer require hexanet/monolog-extra-bundle

Applications that don't use Symfony Flex

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:, (*4)

$ composer require hexanet/monolog-extra-bundle

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation., (*5)

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:, (*6)

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Hexanet\Common\MonologExtraBundle\HexanetMonologExtraBundle(),
        );
        // ...
    }

    // ...
}

Usage

Processors

The bundle provides several processors:, (*7)

  • User
  • Session ID
  • UID
  • Additions

User

The UserProcessor add data about the current user in each log entry., (*8)

hexanet_monolog_extra:
    processor:
        user: true

The default provider returns: * anonymous when no user is logged * the username of the current logged user * cli, (*9)

You can create your own provider by creating a service that implements Hexanet\Common\MonologExtraBundle\Provider\User\UserProviderInterface., (*10)

hexanet_monolog_extra:
    provider:
        user: your_own_provider_service_id

Session ID

Add the session id in each log entry., (*11)

hexanet_monolog_extra:
    processor:
        session_id: true

You can create your own provider by creating a service that implements Hexanet\Common\MonologExtraBundle\Provider\Session\SessionIdProviderInterface., (*12)

hexanet_monolog_extra:
    provider:
        session_id: your_own_provider_service_id

UID

Add an unique identifier for the request in each log entry., (*13)

hexanet_monolog_extra:
    processor:
        uid: true

The bundle comes with 2 providers:, (*14)

  • UniqidProvider (default): use uniqid
  • ApacheUniqueIdProvider: get from environment, need mod_unique_id of Apache

You can create your own provider by creating a service that implements Hexanet\Common\MonologExtraBundle\Provider\Uid\UidProviderInterface., (*15)

hexanet_monolog_extra:
    provider:
        uid: your_own_provider_service_id

Additions

Add custom data in each log entry., (*16)

hexanet_monolog_extra:
    processor:
        additions:
            type: symfony
            application: the best symfony application
            locale: "%locale%"
            environment: "%kernel.environment%"

Loggers

On request

Create a log entry with the request data., (*17)

On response

Create a log entry with the response data., (*18)

On console exception

Create a log entry when an exception occurs in console., (*19)

Add UID to response

Add the UID of the previous processor in the response headers., (*20)

HTTP/1.1 302 Found
X-UID: 57c5f5e842b10

Configuration reference

Configuration reference for a reference on the available configuration options., (*21)

Credits

Developed by Hexanet., (*22)

License

MonologExtraBundle is licensed under the MIT license., (*23)

The Versions

13/04 2018

dev-master

9999999-dev

Symfony bundle with extra processors and logger to log request/response

  Sources   Download

MIT

The Requires

 

The Development Requires

by Floran Brutel

log logging

13/04 2018

v3.0.1

3.0.1.0

Symfony bundle with extra processors and logger to log request/response

  Sources   Download

MIT

The Requires

 

The Development Requires

by Floran Brutel

log logging

13/04 2018

v3.0.0

3.0.0.0

Symfony bundle with extra processors and logger to log request/response

  Sources   Download

MIT

The Requires

 

The Development Requires

by Floran Brutel

log logging

03/04 2018

v2.2.1

2.2.1.0

Symfony bundle with extra processors and logger to log request/response

  Sources   Download

MIT

The Requires

 

The Development Requires

by Floran Brutel

log logging

29/03 2018

v2.2.0

2.2.0.0

Symfony bundle with extra processors and logger to log request/response

  Sources   Download

MIT

The Requires

 

The Development Requires

by Floran Brutel

log logging

29/03 2018

dev-standardized-instructions

dev-standardized-instructions

Symfony bundle with extra processors and logger to log request/response

  Sources   Download

MIT

The Requires

 

The Development Requires

by Floran Brutel

log logging

29/03 2018

dev-console-error-event

dev-console-error-event

Symfony bundle with extra processors and logger to log request/response

  Sources   Download

MIT

The Requires

 

The Development Requires

by Floran Brutel

log logging

22/11 2017

v2.1.0

2.1.0.0

Symfony bundle with extra processors and logger to log request/response

  Sources   Download

MIT

The Requires

 

The Development Requires

by Floran Brutel

log logging

25/08 2017

v2.0.0

2.0.0.0

Symfony bundle with extra processors and logger to log request/response

  Sources   Download

MIT

The Requires

 

The Development Requires

by Floran Brutel

log logging

05/07 2017

v1.0.1

1.0.1.0

Symfony bundle with extra processors and logger to log request/response

  Sources   Download

MIT

The Requires

 

The Development Requires

by Floran Brutel

log logging

07/09 2016

v1.0.0

1.0.0.0

Symfony bundle with extra processors and logger to log request/response

  Sources   Download

MIT

The Requires

 

The Development Requires

by Floran Brutel

log logging