src/Controller.php
public function use_handler( HandlerInterface $handler, array $channels = [], $handler_id = NULL ) {

		add_action(
			HandlersRegistry::ACTION_REGISTER,
			function ( HandlersRegistry $registry ) use ( $handler_id, $handler ) {

				$registry->add_handler( $handler, $handler_id );
			},
			1
		);

		( $handler_id === null ) and $handler_id = $handler;

		add_action(
			Channels::ACTION_LOGGER,
			function ( Logger $logger, HandlersRegistry $handlers ) use ( $handler_id, $channels ) {

				if ( $channels === [] || in_array( $logger->getName(), $channels, TRUE ) ) {
					$logger->pushHandler( $handlers->find( $handler_id ) );
				}
			},
			10,
			2
		);

		return $this;
	}
public function use_handler( HandlerInterface $handler, array $channels = [], $handler_id = NULL ) {

		add_action(
			HandlersRegistry::ACTION_REGISTER,
			function ( HandlersRegistry $registry ) use ( $handler_id, $handler ) {

				$registry->add_handler( $handler, $handler_id );
			},
			1
		);

		( $handler_id === null ) and $handler_id = $handler;

		add_action(
			Channels::ACTION_LOGGER,
			function ( Logger $logger, HandlersRegistry $handlers ) use ( $handler_id, $channels ) {

				if ( $channels === [] || in_array( $logger->getName(), $channels, TRUE ) ) {
					$logger->pushHandler( $handlers->find( $handler_id ) );
				}
			},
			10,
			2
		);

		return $this;
	}
public function use_handler ( HandlerInterface $ handler , array $ channels = [ ] , $ handler_id = NULL ) { add_action ( HandlersRegistry :: ACTION_REGISTER , function ( HandlersRegistry $ registry ) use ( $ handler_id , $ handler ) { $ registry -> add_handler ( $ handler , $ handler_id ) ; } , 1 ) ; ( $ handler_id === null ) and $ handler_id = $ handler ; add_action ( Channels :: ACTION_LOGGER , function ( Logger $ logger , HandlersRegistry $ handlers ) use ( $ handler_id , $ channels ) { if ( $ channels === [ ] || in_array ( $ logger -> getName ( ) , $ channels , TRUE ) ) { $ logger -> pushHandler ( $ handlers -> find ( $ handler_id ) ) ; } } , 10 , 2 ) ; return $ this ; }
Tell Wonolog to make given handler available to loggers with given id. If one or more channels are passed,
the handler will be attached to related Monolog loggers.

@param HandlerInterface $handler
@param string[]         $channels
@param string|NULL      $handler_id

@return Controller
Tell Wonolog to make given handler available to loggers with given id . If one or more channels are passed the handler will be attached to related Monolog loggers .