PHPackages                             khuetd/m2-custom-log - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. khuetd/m2-custom-log

ActiveMagento2-module

khuetd/m2-custom-log
====================

Improve the log for magento 2 with custom format

0.0.6(6y ago)0223OSL-3.0PHPPHP &gt;=7.0

Since Apr 5Pushed 6y ago1 watchersCompare

[ Source](https://github.com/khuebt/custom-logger-m2)[ Packagist](https://packagist.org/packages/khuetd/m2-custom-log)[ RSS](/packages/khuetd-m2-custom-log/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (6)Used By (0)

Mage2 Module Ktd LogHandler
===========================

[](#mage2-module-ktd-loghandler)

```
``ktd/custom-log``

```

- [Main Functionalities](#markdown-header-main-functionalities)
- [Installation](#markdown-header-installation)
- [Configuration](#markdown-header-configuration)
- [Specifications](#markdown-header-specifications)
- [Attributes](#markdown-header-attributes)

Main Functionalities
--------------------

[](#main-functionalities)

Improve the log for magento 2 with custom format

Installation
------------

[](#installation)

\* = in production please use the `--keep-generated` option

### Type 1: Zip file

[](#type-1-zip-file)

- Unzip the zip file in `app/code/Ktd`
- Enable the module by running `php bin/magento module:enable Ktd_LogHandler`
- Apply database updates by running `php bin/magento setup:upgrade`\*
- Flush the cache by running `php bin/magento cache:flush`

### Type 2: Composer

[](#type-2-composer)

- Make the module available in a composer repository for example:
    - private repository `repo.magento.com`
    - public repository `packagist.org`
    - public github repository as vcs
- Add the composer repository to the configuration by running `composer config repositories.repo.magento.com composer https://repo.magento.com/`
- Install the module composer by running `composer require ktd/custom-log`
- enable the module by running `php bin/magento module:enable Ktd_LogHandler`
- apply database updates by running `php bin/magento setup:upgrade`\*
- Flush the cache by running `php bin/magento cache:flush`

Configuration
-------------

[](#configuration)

Use
---

[](#use)

```
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
   /** @var \Ktd\LogHandler\Helper\Data $log */
$log = $objectManager->get('\Ktd\LogHandler\Helper\Data');

$log->setFuncDebug('saleorder'); //set filename
$logType = 'ORDER';
$logApiType = 'SO-ORDER';

$req = ['sample' => 1];
$res = ['success' => 1];

$apiname = 'http://URL_API';
$req = json_encode($req);
$res = json_encode($res);

$log->debuglog($logType, array(
    $logApiType,
    "API : $apiname",
    "REQ : $req",
    "RES : $res"
));

```

Result in log
-------------

[](#result-in-log)

```
Log path: MAGENTO_ROOT_FOLDER/var/log/api/saleorder_debug_2020-04-05.log

2020-04-05 13:08:25|DEBUG|8aprmocv1b38g4n3d809m8pr79|ORDER|SO-ORDER|API : http://URL_API|REQ : {"sample":1}|RES : {"success":1}

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

5

Last Release

2225d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16019577?v=4)[TDK](/maintainers/khuebt)[@khuebt](https://github.com/khuebt)

---

Top Contributors

[![khuebt](https://avatars.githubusercontent.com/u/16019577?v=4)](https://github.com/khuebt "khuebt (11 commits)")

### Embed Badge

![Health badge](/badges/khuetd-m2-custom-log/health.svg)

```
[![Health](https://phpackages.com/badges/khuetd-m2-custom-log/health.svg)](https://phpackages.com/packages/khuetd-m2-custom-log)
```

###  Alternatives

[elgg/elgg

Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications.

1.7k15.7k4](/packages/elgg-elgg)[graycore/magento2-stdlogging

A Magento 2 module that changes all logging handlers to stdout

2382.6k](/packages/graycore-magento2-stdlogging)[zepgram/module-rest

Technical module to industrialize API REST call with dependency injection pattern using Guzzle library

1326.2k](/packages/zepgram-module-rest)[mage-os/module-automatic-translation

Automatic AI content translation for Mage-OS.

277.1k](/packages/mage-os-module-automatic-translation)[graycore/magento2-graphql-introspection-cache

1015.2k](/packages/graycore-magento2-graphql-introspection-cache)[mage-os/mageos-common-async-events

Send REST requests to external endpoints asynchronously. This module implements the most common events like order creation and customer change.

147.7k2](/packages/mage-os-mageos-common-async-events)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
