定制 bydn/improved-logger 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bydn/improved-logger

最新稳定版本:1.0.2

Composer 安装命令:

composer require bydn/improved-logger

包简介

Improved Logger

README 文档

README

Bydn_ImprovedLogger is a Magento 2 module designed to enhance system logging by providing contextual information and real-time alerts. It uses Monolog processors and handlers to enrich log data and send notifications via Email and Telegram.

Features

1. Extended Log Information

The module adds useful metadata to every log entry, making debugging significantly easier by identifying exactly where and how a log was generated.

  • IP Addresses: Adds Remote IP, Server IP, and Client IP.
  • Request URL: Records the full browser URL where the log occurred.
  • Controller Info: Includes the module, controller, and action name.
  • Trace Info: Automatically detects the exact file and line number that called the logger.

2. Real-time Notifications

Stay informed about critical system issues as they happen.

  • Email Alerts: Sends log details to configured email addresses.
  • Telegram Notifications: Pushes alerts directly to a Telegram chat via Bot API.
  • Filtered Alerts: By default, notifications are triggered for Critical and Emergency log levels.

Configuration

Navigate to Stores > Configuration > Utilities (by DN) > Improved Logger to manage the module settings.

Log Files Extra Info

  • Enable extra info: Global toggle for log enrichment.
  • Add IP info: Toggle IP address logging.
  • Add browser URL: Toggle current URL logging.
  • Add controller info: Toggle Magento request metadata.
  • Add caller info: Toggle file/line trace (Note: small performance impact).

Notifications (Email & Telegram)

  • Email/Telegram Enable: Toggle the respective notification service.
  • Credentials: Configure Email destinations or Telegram Bot Token and Chat ID.
  • Exception Logging: (Optional) Send all exception.log records via the selected channel.

Installation

composer require bydn/improved-logger
bin/magento module:enable Bydn_ImprovedLogger
bin/magento setup:upgrade
bin/magento cache:flush

Technical Overview

  • Processor: Bydn\ImprovedLogger\Processor\Extrainfo implements a Monolog processor to inject data into the $record->extra array.
  • Handler: Bydn\ImprovedLogger\Handler\Notification is a custom Monolog handler that intercepts log records and triggers notification models.
  • Plugin: A plugin on Magento\Framework\Logger\Monolog ensures the custom handler is correctly pushed into the Monolog stack.

Note

This module is designed with extensibility in mind, allowing for easy addition of new notification channels or data processors.

统计信息

  • 总下载量: 66
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固