[GH-ISSUE #716] Allow to use different LogHandler with the same LogLevel #265

Closed
opened 2026-03-04 02:13:37 +03:00 by kerem · 2 comments
Owner

Originally created by @ghost on GitHub (Jan 11, 2016).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/716

Let's say I have a use case in which I use the SyslogUdpHandler as my standard logger.
This logger has the Loglevel Debug by default.
When I have a special usecase, where I want to log specific data into a file using StreamHandler with LogLevel Debug this is not possible because I have another handler already set for this level.

Proposal

Logger::addRecord() exits early which is pretty good actually.
But maybe it could be some improvement, to add some extra check if the handlers with the same loglevel are handlers of the same type, so that they would not interfere each other?

Not sure if this is suppressed by purpose, but if so, please let me know.

Cheers

Originally created by @ghost on GitHub (Jan 11, 2016). Original GitHub issue: https://github.com/Seldaek/monolog/issues/716 Let's say I have a use case in which I use the `SyslogUdpHandler` as my standard logger. This logger has the Loglevel `Debug` by default. When I have a special usecase, where I want to log specific data into a file using `StreamHandler` with LogLevel `Debug` this is not possible because I have another handler already set for this level. ### Proposal `Logger::addRecord()` exits early which is pretty good actually. But maybe it could be some improvement, to add some extra check if the handlers with the same loglevel are handlers of the same type, so that they would not interfere each other? Not sure if this is suppressed by purpose, but if so, please let me know. Cheers
kerem closed this issue 2026-03-04 02:13:37 +03:00
Author
Owner

@xabbuh commented on GitHub (Jan 12, 2016):

Isn't the GroupHandler what you are looking for?

<!-- gh-comment-id:170876642 --> @xabbuh commented on GitHub (Jan 12, 2016): Isn't the [GroupHandler](https://github.com/Seldaek/monolog/blob/master/doc/02-handlers-formatters-processors.md#wrappers--special-handlers) what you are looking for?
Author
Owner

@ghost commented on GitHub (Jan 12, 2016):

Thanks a lot!
I did not see this. Seems that could be what I'm looking for.

<!-- gh-comment-id:170878718 --> @ghost commented on GitHub (Jan 12, 2016): Thanks a lot! I did not see this. Seems that could be what I'm looking for.
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#265
No description provided.