I am looking into using monolog in an application I am working on but I am unsure whether I would be able to implement what I require using the FingersCrosedHandler.
I would like to only log DEBUG level messages if a message with a level of ERROR or higher is added, however I would like to see INFO messages in the log.
I have tried:
$applicationLog = new Monolog\Logger('App');
$streamHandler = new Monolog\Handler\StreamHandler(LOG_FILE, Monolog\Logger::DEBUG, false);
$fingersCrossedHandler = new Monolog\Handler\FingersCrossedHandler($streamHandler, Monolog\Logger::INFO, 0 , false);
$applicationLog->pushHandler($fingersCrossedHandler);
$applicationLog->addDebug('debug');
$applicationLog->addInfo('info');
But this adds both debug and info level messages to the log.
Is this possible to implement using the FingersCrossedHandler or would I need to create my own?