DataAggregator icon indicating copy to clipboard operation
DataAggregator copied to clipboard

MonologAdaptor::log() is .. less than optimal

Open mweibel opened this issue 9 years ago • 0 comments

log implementation: https://github.com/liip/DataAggregator/blob/master/src/Liip/DataAggregator/Adaptor/Logger/MonologAdaptor.php#L155

info implementation: https://github.com/liip/DataAggregator/blob/master/src/Liip/DataAggregator/Adaptor/Logger/MonologAdaptor.php#L125

So, if you call ->log('critical', 'some critical message', ['some' => 'context'); this will make a call to ->info('critical', 'some critical message');. Therefore the message being logged is critical and the context is a string instead of an array.

In case I don't oversee something, this is bug, if not dangerous if anybody is using that. If monolog doesn't support log then the Adaptor should rather make a switch on the level and call the appropriate method.

mweibel avatar Oct 12 '16 09:10 mweibel