wearejh / m2-module-logger
Logger Module for Magento 2
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 9
Forks: 0
Open Issues: 1
pkg:composer/wearejh/m2-module-logger
This package is auto-updated.
Last update: 2025-09-26 15:37:29 UTC
README
Overview
This module was created to extend the core log functionality with database storage.
Raising an event
public function addEvent(
string $type,
string $message = '',
string $identifierLabel = '',
string $identifierValue = '',
int $severity = 1,
bool $createIssue = true,
\Exception $exception = null
): bool;
which comes from \Jh\Logger\Api\LoggerManagementInterface
, which can be injected into constructor and used like the following
public function __construct(
LoggerManagementInterface $loggerManagement,
) {
$this->loggerManagement = $loggerManagement;
}
and then can be used this->loggerManagement->addEvent(...)
with the following arguments above.
Closing an issue
public function closeIssue(string $type): bool
Which comes from Jh\Logger\Api\LoggerManagementInterface
which can be injected into via constructor method
public function __construct(
LoggerManagementInterface $loggerManagement,
) {
$this->loggerManagement = $loggerManagement;
}
and then can be used as follows $this->loggerManagement->closeIssue("API error")