wa0x6e/php-resque-ex

Logging does not work with Monolog 2.*

mfn opened this issue · 1 comments

mfn commented

The current master depends on monolog >= 1.2.0 =>

"monolog/monolog": ">=1.2.0",

In the meantime Monolog 2.0 was released and non-PSR methods were removed, see https://github.com/Seldaek/monolog/blob/2.0.0/CHANGELOG.md#200-beta1-2018-12-08

BC Break: Removed non-PSR-3 methods to add records, all the add* (e.g. addWarning) methods as well as emerg, crit, err and warn

However this packages uses those non-PSR-3 methods:

  • $this->logger->addInfo($message, $extra);
    break;
    case self::LOG_TYPE_WARNING:
    $this->logger->addWarning($message, $extra);
    break;
    case self::LOG_TYPE_ERROR:
    $this->logger->addError($message, $extra);
    break;
    case self::LOG_TYPE_CRITICAL:
    $this->logger->addCritical($message, $extra);
    break;
    case self::LOG_TYPE_ALERT:
    $this->logger->addAlert($message, $extra);
  • $this->logger->addDebug($message, $extra);
  • (not sure I found all places)

If monolog 1.x is fine for the rest of the project used, one can work around this by adding an explicit dependency on monolog 1.x with something like this:

composer require monolog/monolog:^1.0
mfn commented

Not using resque anymore -> closing