Git Product home page Git Product logo

logger-extra-bundle's Introduction

DeamonLoggerExtra Bundle

Build status Scrutinizer Code Quality Code Coverage symfony version php version

This project is used to add extra context information in your logs.

If you need compatibility with previous Symfony versions, have a look at previous releases.

Requirements

php >=8.0.2

symfony/security-core symfony/dependency-injection symfony/monolog-bridge symfony/http-kernel symfony/http-foundation symfony/config

Compatible with Symfony starting from 6.0.
Tags follow Symfony versions.

Installation

You need to add a package to your dependency list :

    // composer.json
    "deamon/logger-extra-bundle": "^6.0"

Then enable the bundle into your kernel

    // config/bundles.php
    return [
        // ...
        App\Acme\TestBundle\AcmeTestBundle::class => ['all' => true],
    ];

Finally you need to configure the bundle.

Config Example

Given this config sample of a project:

// config/packages/monolog.yml
monolog:
    handlers:
        main:
            type: stream
            path: "%kernel.logs_dir%/%kernel.environment%.log"
            level: debug
            channels: ["!event"]

With this example of monolog config, you can configure this bundle to only add extra info on main handler.

// config/packages/deamon_logger_extra.yml
deamon_logger_extra:
    application:  
        name: "loc-deamonfront"
        version: "v0.1"
    handlers: [main]

Config reference

// config/packages/deamon_logger_extra.yaml
deamon_logger_extra:
    application:
        name: "loc-deamonfront" # default to null
        locale: "fr" # default to null
        version: "v0.1" # default to null
    handlers: [main] # the only required field
    config:
        channel_prefix: "v0.1" # default to null
        user_class: "\\Symfony\\\Component\\Security\\Core\\User\\UserInterface" # default to null
        user_methods:
            user_name: getUsername # default value
        display:
            env: false # default to true
            locale: false # default to true
            application_name: false # default to true
            url: false # default to true
            route: false # default to true
            user_agent: false # default to true
            accept_encoding: false # default to true
            client_ip: false # default to true
            user: false # default to true
            global_channel: false # default to true

Minimal configuration

// config/packages/deamon_logger_extra.yaml
deamon_logger_extra:
    application: null
    handlers: ['main']
    config: null

logger-extra-bundle's People

Contributors

deamon avatar thomasp1992 avatar jadelrab avatar louispaulet avatar

Watchers

Bruno Dabo avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.