Giter Club home page Giter Club logo

Comments (9)

Seldaek avatar Seldaek commented on July 27, 2024

By default a channel that has no handler will use the "default" handler of monolog defined as such:

        if (!$this->handlers) {
            $this->pushHandler(new StreamHandler('php://stderr', static::DEBUG));
        }

In retrospect this sounds like a bad idea that should probably be removed in 2.0 :)

But that means for now yes you can define a mute handler like you did, or we could fix it in the bundle so that symfony adds a null handler by default to channels that have nothing, or it could even inject a Psr\Log\NullLogger instead of a monolog instance I suppose. But symfony until 3.0 has legacy stuff emerg/crit/err/warn in it's LoggerInterface so the null logger should probably be extended by the bundle as well to provide those.

from monolog-bundle.

matthiasnoback avatar matthiasnoback commented on July 27, 2024

Thanks for this excellent and very interesting answer! It explains a lot.

from monolog-bundle.

Seldaek avatar Seldaek commented on July 27, 2024

If you'd like to work on a PR that'd be great, otherwise let's leave this open for when someone has time.

from monolog-bundle.

stof avatar stof commented on July 27, 2024

so the null logger should probably be extended by the bundle as well to provide those.

HttpKernel already contains such a NullLogger btw

from monolog-bundle.

Seldaek avatar Seldaek commented on July 27, 2024

Ah right then it's an easier PR :)

from monolog-bundle.

matthiasnoback avatar matthiasnoback commented on July 27, 2024

I'll keep it in mind!

from monolog-bundle.

matthiasnoback avatar matthiasnoback commented on July 27, 2024

I mean - the "maybe create a PR" part ;)

from monolog-bundle.

fabpot avatar fabpot commented on July 27, 2024

fixed by #177 (I would have loved to read this before investigating the issue, it would have saved me some time :))

from monolog-bundle.

Seldaek avatar Seldaek commented on July 27, 2024

Thanks @fabpot, for the record monolog 2.0 doesn't do this default handler thing anymore, but it's not yet stable either.

from monolog-bundle.

Related Issues (20)

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.