[GH-ISSUE #694] Extending/custom processors #256

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

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.

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.
kerem closed this issue 2026-03-04 02:13:32 +03:00
Author
Owner

@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

<!-- gh-comment-id:160796573 --> @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
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#256
No description provided.