← All modules

Magento 2 module · foundation

Log Wrapper

Technical helper that lets Infrangible modules write log messages to several log files at once.

Log Wrapper is a small technical module. It replaces the standard logging of Magento with a wrapper that forwards every message to the usual Magento logs and, on demand, to additional log destinations at the same time. Other Infrangible modules use this to write the progress of a job into its own log file while still keeping the normal system logs complete.

Merchants normally don’t install it directly: it is pulled in automatically by modules that need it, such as “Task”.

Features

  • All log messages continue to go to the standard Magento log files.
  • Modules can add further log destinations for a while, for example a separate log file per task run, so one message ends up in several logs.

Configuration

There is nothing to configure. The module works right after installation and does not change anything visible in the store or admin.

Good to know

Log Wrapper is a building block of “Task”, which uses it to keep a separate log for every run of a background task.

Installation

Install the module with Composer in your Magento root directory:

composer require infrangible/m2-log

Then enable it and update the store as described in the installation guide.