wearejh/m2-module-logger

There is no license information available for the latest version (1.0.3) of this package.

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

1.0.3 2025-05-13 16:05 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")