Download the PHP package thereddot/monolog-extra-bundle without Composer
On this page you can find all versions of the php package thereddot/monolog-extra-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package monolog-extra-bundle
MonologExtraBundle
❗ This package is abandoned and no longer actively maintained.
Symfony bundle with extra processors and logger to log request/response/command.
Installation
Applications that use Symfony Flex
Open a command console, enter your project directory and execute:
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:
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
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:
Usage
Processors
The bundle provides several processors:
- User
- Session id
- Request id
- Additions
User
The UserProcessor add data about the current user in each log entry.
The default provider SymfonyUserProvider
returns:
- anonymous when no user is logged
- the username of the current logged user
- cli
You can customize the provider to replace the username by another property:
You can create your own provider by creating a service that implements TheRedDot\MonologExtraBundle\Provider\User\UserProviderInterface.
Session id
Add the session id in each log entry.
You can create your own provider by creating a service that implements TheRedDot\MonologExtraBundle\Provider\Session\SessionIdProviderInterface.
Request id
Add the request id for the request in each log entry.
The bundle comes with 2 providers:
- UniqidProvider (default): use
uniqid
- ServerRequestIdProvider: get from
$_SERVER
- you need to pass the name of a field of
$_SERVER
, example for mod_unique_id of Apache:UNIQUE_ID
.
- you need to pass the name of a field of
You can create your own provider by creating a service that implements TheRedDot\MonologExtraBundle\Provider\RequestId\RequestIdProviderInterface.
Additions
Add custom data in each log entry.
Loggers
On request
Create a log entry with the request data.
On response
Create a log entry with the response data.
On console command
Create a log entry before executing any command.
On console exception
Create a log entry when an exception occurs in console.
Add request id to response
Add the request id of the previous processor in the response headers.
Configuration reference
Configuration reference for a reference on the available configuration options.
Credits
Forked from Hexanet/MonologExtraBundle.
License
MonologExtraBundle is licensed under the MIT license.
All versions of monolog-extra-bundle with dependencies
symfony/config Version ^3.4 || ^4.4 || ^5.0
symfony/dependency-injection Version ^3.4 || ^4.4 || ^5.0
symfony/http-foundation Version ^3.4 || ^4.4 || ^5.0
symfony/http-kernel Version ^3.4 || ^4.4 || ^5.0
symfony/monolog-bundle Version ^3.0
symfony/property-access Version ^3.4 || ^4.4 || ^5.0
symfony/security-core Version ^3.4 || ^4.4 || ^5.0