/** * Loads the closures as option handlers. Add handlers to this function if * you want to support additional custom options. * * The syntax is the following: * array( * '\Full\Absolute\Namespace\ClassName' => array( * 'myOption' => Closure * ), ... * ) * * You can use the '*' wildcard if you want to set up an option for all * Handler classes */ public static function initExtraOptionsHandlers() { self::$extraOptionHandlers = array('*' => array('formatter' => function ($instance, FormatterInterface $formatter) { $instance->setFormatter($formatter); }), 'Monolog\\Handler\\LogglyHandler' => array('tags' => function ($instance, $tags) { $instance->setTag($tags); })); }
/** * Loads the closures as option handlers. Add handlers to this function if * you want to support additional custom options. * * The syntax is the following: * array( * '\Full\Absolute\Namespace\ClassName' => array( * 'myOption' => Closure * ), ... * ) * * You can use the '*' wildcard if you want to set up an option for all * Handler classes */ public static function initExtraOptionsHandlers() { self::$extraOptionHandlers = array('*' => array('formatter' => function ($instance, FormatterInterface $formatter) { $instance->setFormatter($formatter); }, 'processors' => function ($instance, array $processors) { // We need to reverse the array because Monolog "pushes" processors to top of the stack foreach (array_reverse($processors) as $processor) { $instance->pushProcessor($processor); } }), 'Monolog\\Handler\\LogglyHandler' => array('tags' => function ($instance, $tags) { $instance->setTag($tags); })); }