Fallback to `Civi::log()` if no logger injected by `hook_civirules_getlogger`
CiviRules looks for a logger by calling its civirules_getlogger
hook. If this hook is not implemented by another extension (that injects a logger that implements \Psr\Log\LoggerInterface
), no logger is used, and messages won't get logged.
For a long time Civi-core includes a \Psr\Log\LoggerInterface
compatible logger: Civi::log()
. This could be used as a fallback logger, if no other logger is provided by the hook.
This way custom loggers still can be used, and CiviRules will log errors to the general CiviCRM log out of the box also this log is rotated by Civi-core.