mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-27 00:25:50 +03:00
[GH-ISSUE #694] Extending/custom processors #256
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#256
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 @rreynier on GitHub (Nov 30, 2015).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/694
There only seems to be documentation regarding creating your own handlers, but how about processors? My use case is that I need to add some information regarding the connected database. Just like webprocessor adds information regarding the web request, this processor would add information regarding the connected database (primarily database name). (single tenancy.. ugh I know ;)).
Anyway, is there a recommended way to do custom processors? We dont seem to be extending an interface or anything along those lines.
@staabm commented on GitHub (Nov 30, 2015):
A processor is just a callable nothing more, e.g. a class implementing
__invoke()or just a lambda function.See https://github.com/Seldaek/monolog/blob/master/src/Monolog/Logger.php#L139