Documentation

ChannelLevelActivationStrategy
in package
implements ActivationStrategyInterface

Channel and Error level based monolog activation strategy. Allows to trigger activation based on level per channel. e.g. trigger activation on level 'ERROR' by default, except for records of the 'sql' channel; those should trigger activation on level 'WARN'.

Example:

$activationStrategy = new ChannelLevelActivationStrategy( Logger::CRITICAL, array( 'request' => Logger::ALERT, 'sensitive' => Logger::ERROR, ) ); $handler = new FingersCrossedHandler(new StreamHandler('php://stderr'), $activationStrategy);
Tags
author

Mike Meessen netmikey@gmail.com

Table of Contents

Interfaces

ActivationStrategyInterface
Interface for activation strategies for the FingersCrossedHandler.

Properties

$channelToActionLevel  : mixed
$defaultActionLevel  : mixed

Methods

__construct()  : mixed
isHandlerActivated()  : bool
Returns whether the given record activates the handler.

Properties

Methods

__construct()

public __construct(int $defaultActionLevel[, array<string|int, mixed> $channelToActionLevel = array() ]) : mixed
Parameters
$defaultActionLevel : int

The default action level to be used if the record's category doesn't match any

$channelToActionLevel : array<string|int, mixed> = array()

An array that maps channel names to action levels.

isHandlerActivated()

Returns whether the given record activates the handler.

public isHandlerActivated(array<string|int, mixed> $record) : bool
Parameters
$record : array<string|int, mixed>
Return values
bool

        
On this page

Search results