mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-26 16:15:49 +03:00
[GH-ISSUE #363] Retrieving all registered handlers #121
Labels
No labels
Bug
Documentation
Feature
Needs Work
Support
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/monolog#121
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @auroraeosrose on GitHub (Apr 30, 2014).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/363
Sometimes you want to re-create a Logger you've already created exactly, only with a different name. The issue is you
The only way around this is evil code that pops everything off and stores it, and pops everything on, or stores handlers in another location in the app every time (which in large apps is obnoxious, especially when your handler sets can be quite disparate or controlled entirely by environment)
Can we possibly get a "getHandlers()" method that just returns the contents of the protected $handlers array? corollary, getProcessors() would be great as well
$copied_logger = new Logger('newname', $old->getHandlers(), $old->getProcessors());
would make my life 200% better ;)
@Seldaek commented on GitHub (May 1, 2014):
Makes sense, it's just that nobody asked or needed this before :)