This was changed in version 1.11.0
of Monolog. There's now an optional 6th parameter, $passThruLevel
. This parameter is the minimum level log that should always be flushed. In your case, you should set up FingersCrossed in the following manner:
use Monolog\Handler\FingersCrossedHandler;
$fingersCrossedHandler = new FingersCrossedHandler(
$streamHandler,
Monolog\Logger::ERROR,
0,
true,
true,
Monolog\Logger::INFO
);
This will result in INFO
or higher messages always being logged, but DEBUG
messages will only show up if an ERROR
level or higher message has been logged.