[GH-ISSUE #14] configuration file support #1

Closed
opened 2026-03-04 02:11:14 +03:00 by kerem · 1 comment
Owner

Originally created by @ykhrustalev on GitHub (Apr 18, 2011).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/14

Hi

Monolog looks very light and simple what makes it attractive to use in other projects not related to Symfony.
Is it possible to add configuration file to allow specify some channel options.
For the channel name

  • Handlers to push
  • Message level

Some thing like is done in Symfony2 config but in very simple way.

May be it is a goo idea to create factory method to get loggers by the channel name.

Hope you find that issue reasonable.

Originally created by @ykhrustalev on GitHub (Apr 18, 2011). Original GitHub issue: https://github.com/Seldaek/monolog/issues/14 Hi Monolog looks very light and simple what makes it attractive to use in other projects not related to Symfony. Is it possible to add configuration file to allow specify some channel options. For the channel name - Handlers to push - Message level Some thing like is done in Symfony2 config but in very simple way. May be it is a goo idea to create factory method to get loggers by the channel name. Hope you find that issue reasonable.
kerem closed this issue 2026-03-04 02:11:14 +03:00
Author
Owner

@Seldaek commented on GitHub (Apr 19, 2011):

It's certainly possible, but it's not that much code to write yourself to set up your handlers. I'm not sure if this is really valuable, I'd say it's more something that should be done in whichever project integrates monolog (be it homegrown or a framework like Sf2).

I mean in most cases you need one or two handlers, and you need some point where you integrate monolog anyway, so why not add those few lines of setup code there?

As for the factory method, that sounds like a glorified singleton what you're saying, and I really don't think that's the best idea. You can do it easily by extending the Logger class, or by stashing logger instances anywhere else, but I don't think this belongs in the library.

<!-- gh-comment-id:1025631 --> @Seldaek commented on GitHub (Apr 19, 2011): It's certainly possible, but it's not that much code to write yourself to set up your handlers. I'm not sure if this is really valuable, I'd say it's more something that should be done in whichever project integrates monolog (be it homegrown or a framework like Sf2). I mean in most cases you need one or two handlers, and you need some point where you integrate monolog anyway, so why not add those few lines of setup code there? As for the factory method, that sounds like a glorified singleton what you're saying, and I really don't think that's the best idea. You can do it easily by extending the Logger class, or by stashing logger instances anywhere else, but I don't think this belongs in the library.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#1
No description provided.