Can I add a Processor to just one Monolog handler?

850 Views Asked by At

Can I add a Processor to just one Monolog handler? Or is there some other way I can alter a message that is only going out to one particular handler?

I want to add a text string to the end of $record['message']. I can do this now with a processor, but it affects all my handlers, which is no good for my situation.

Thanks.

1

There are 1 best solutions below

1
On BEST ANSWER

Maybe this link can help you out: https://github.com/Seldaek/monolog/blob/master/doc/01-usage.md#customizing-the-log-format

Also you can add a processor directly to the handler:

$stackifyHandler->pushProcessor(<callable>);

Adds a processor in the stack