PHPackages                             alekseon/log-details - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. alekseon/log-details

ActiveMagento2-module[Logging &amp; Monitoring](/categories/logging)

alekseon/log-details
====================

Magento 2 extension that adds contextual information to system logs

1.0.2(6mo ago)4312OSL-3.0PHP

Since Oct 16Pushed 6mo agoCompare

[ Source](https://github.com/Alekseon/module-log-details)[ Packagist](https://packagist.org/packages/alekseon/log-details)[ Docs](https://github.com/alekseon/log-details)[ RSS](/packages/alekseon-log-details/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

Alekseon Log Details
====================

[](#alekseon-log-details)

 [![Magento 2 Log Details](https://camo.githubusercontent.com/4d67fed5db38ac07528df9de30fb18a8e16cd5f15affad82ce09edf9a67dc460/68747470733a2f2f692e696d6775722e636f6d2f62326f636c48412e706e67)](https://camo.githubusercontent.com/4d67fed5db38ac07528df9de30fb18a8e16cd5f15affad82ce09edf9a67dc460/68747470733a2f2f692e696d6775722e636f6d2f62326f636c48412e706e67)
 Alekseon\_LogDetails

=============================================================================================================================================================================================================================================================================================================================================================================================

[](#------alekseon_logdetails--)

#### Enhanced logging module for Magento 2 that adds contextual information to system logs

[](#enhanced-logging-module-for-magento-2-that-adds-contextual-information-to-system-logs)

*Get better insights from your Magento 2 logs with additional context about web requests, cron jobs, and console commands*

Features
--------

[](#features)

### 🌐 Web Request Context

[](#-web-request-context)

- **IP Address**: Track which IP addresses are generating log entries
- **User Agent**: See what browsers/clients are involved in logged events
- **Referer**: Understand the source of web requests
- **Request URI**: Know which endpoints are generating logs

### ⏰ Cron Job Context

[](#-cron-job-context)

- **Job Code**: Identify which cron job generated the log entry
- **Schedule ID**: Reference the specific cron schedule instance

### 🖥️ Console Command Context

[](#️-console-command-context)

- **Command Name**: Track which CLI command generated the log entry
- **Execution Context**: Understand the source of command-line logs

### 🔍 Trace Logging

[](#-trace-logging)

- **Debug Information**: Enhanced trace logging for development and debugging
- **Stack Trace Context**: Better understanding of code execution flow

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

[](#installation)

In your Magento 2 root directory, install this package via composer:

```
composer require alekseon/log-details
bin/magento setup:upgrade
bin/magento setup:static-content:deploy (if needed)
bin/magento cache:flush
```

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

[](#configuration)

1. Navigate to **Stores &gt; Configuration &gt; Advanced &gt; System &gt; Alekseon Log Details**
2. Configure the following settings:
    - **Enable Web Context**: Add web request details to logs
    - **Enable Cron Context**: Add cron job details to logs
    - **Enable Console Context**: Add CLI command details to logs
    - **Enable Trace Context**: Add trace information for debugging

How It Works
------------

[](#how-it-works)

This module integrates with Magento 2's logging system using Monolog processors. It automatically adds contextual information to log entries without requiring any changes to your existing logging code.

### Log Entry Enhancement

[](#log-entry-enhancement)

**Before:**

```
[2025-01-16 10:00:00] main.INFO: Customer login successful [] []

```

**After:**

```
[2025-01-16 10:00:00] main.INFO: Customer login successful [] {
  "extra": {
    "uri": "/customer/account/login/",
    "ip": "192.168.1.100",
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
    "referer": "https://example.com/checkout"
  }
}

```

Technical Details
-----------------

[](#technical-details)

### Processors

[](#processors)

- **Web Processor**: Adds HTTP request context (IP, User-Agent, Referer, URI)
- **Cron Processor**: Adds cron job context (Job Code, Schedule ID)
- **Console Processor**: Adds CLI command context
- **Trace Processor**: Adds debugging trace information

### Plugins

[](#plugins)

- **SetCronDataPlugin**: Captures cron schedule data for logging
- **SetConsoleCommandDataPlugin**: Captures console command data for logging

### Configuration

[](#configuration-1)

All processors can be individually enabled/disabled through the admin configuration panel.

Support
-------

[](#support)

**Magento Version Compatibility:**

Module Ver.Magento 2.4.4+Magento 2.4.5+Magento 2.4.6+1.x✅✅✅Development / Contribution
--------------------------

[](#development--contribution)

If you want to contribute please follow the below instructions:

1. Create an issue and describe your idea
2. [Fork this repository](https://github.com/Alekseon/module-log-details/fork)
3. Create your feature branch (`git checkout -b my-new-feature`)
4. Commit your changes
5. Publish the branch (`git push origin my-new-feature`)
6. Submit a new Pull Request for review

Issue Tracking
--------------

[](#issue-tracking)

For issues, please use the [issue tracker](https://github.com/Alekseon/module-log-details/issues).

Issues help keep this project alive and strong, so let us know if you find anything!

Dependencies
------------

[](#dependencies)

This module requires:

- **PHP**: 7.4 or higher
- **Magento Framework**: 102.0.0 or higher

Use Cases
---------

[](#use-cases)

### Development &amp; Debugging

[](#development--debugging)

- **API Debugging**: See which clients are calling your APIs
- **Performance Monitoring**: Track slow requests by IP and user agent
- **Error Analysis**: Understand the context of errors and exceptions

### Production Monitoring

[](#production-monitoring)

- **Security Monitoring**: Track suspicious requests and their sources
- **Cron Job Monitoring**: Monitor which cron jobs are generating errors
- **User Behavior Analysis**: Understand user flows that lead to errors

### System Administration

[](#system-administration)

- **Log Analysis**: Better filtering and searching of log files
- **Incident Response**: Faster identification of problem sources
- **System Health**: Enhanced visibility into system operations

Examples
--------

[](#examples)

### Web Request Log Entry

[](#web-request-log-entry)

```
{
  "message": "Payment processing error",
  "context": [],
  "level": 400,
  "extra": {
    "uri": "/checkout/onepage/savePayment/",
    "ip": "203.0.113.1",
    "user-agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X)",
    "referer": "https://example.com/checkout/"
  }
}
```

### Cron Job Log Entry

[](#cron-job-log-entry)

```
{
  "message": "Cron job completed successfully",
  "context": [],
  "level": 200,
  "extra": {
    "cron": {
      "job_code": "catalog_product_alert",
      "schedule_id": "12345"
    }
  }
}
```

### Console Command Log Entry

[](#console-command-log-entry)

```
{
  "message": "Indexer reindex completed",
  "context": [],
  "level": 200,
  "extra": {
    "console": {
      "command": "indexer:reindex"
    }
  }
}
```

License
-------

[](#license)

[The Open Software License 3.0 (OSL-3.0)](https://opensource.org/licenses/OSL-3.0)

About Alekseon
--------------

[](#about-alekseon)

[Alekseon](https://alekseon.com) is a software development company specializing in Magento 2 extensions and custom e-commerce solutions. We create tools that help merchants build better, more secure online stores.

Visit our website to see our full range of Magento 2 extensions:

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance66

Regular maintenance activity

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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

3

Last Release

207d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/34ad40435e893b6fb374da166b0dfa867d75b491db6be84155ceb1d688ab4d7c?d=identicon)[Alekseon](/maintainers/Alekseon)

---

Top Contributors

[![Linek](https://avatars.githubusercontent.com/u/136248?v=4)](https://github.com/Linek "Linek (5 commits)")

---

Tags

loggingdebuggingContextmagento2alekseon

### Embed Badge

![Health badge](/badges/alekseon-log-details/health.svg)

```
[![Health](https://phpackages.com/badges/alekseon-log-details/health.svg)](https://phpackages.com/packages/alekseon-log-details)
```

###  Alternatives

[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[rollbar/rollbar

Monitors errors and exceptions and reports them to Rollbar

33723.7M82](/packages/rollbar-rollbar)[analog/analog

Fast, flexible, easy PSR-3-compatible PHP logging package with dozens of handlers.

3451.5M24](/packages/analog-analog)[inpsyde/wonolog

Monolog-based logging package for WordPress.

183617.9k7](/packages/inpsyde-wonolog)[honeybadger-io/honeybadger-laravel

Honeybadger Laravel integration

431.2M](/packages/honeybadger-io-honeybadger-laravel)[honeybadger-io/honeybadger-php

Honeybadger PHP library

381.5M4](/packages/honeybadger-io-honeybadger-php)

PHPackages © 2026

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