bitrix-logger

Implement PSR-3 logging for Bitrix modules with configurable backends.

33|3|Updated Jun 5, 2025
One-click install
npx skills add https://github.com/bxmaximum/bitrix_ai_challenge --skill bitrix-logger
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bitrix-logger
Source: https://github.com/bxmaximum/bitrix_ai_challenge/tree/main/.agents/skills/bitrix-logger
Command: npx skills add https://github.com/bxmaximum/bitrix_ai_challenge --skill bitrix-logger

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Logging in Bitrix often lacks standardization across modules, and PSR-3 integration is needed to unify log output, improve debugging, and enable centralized management of log backends and formats.

Core Features & Use Cases

  • PSR-3 compliance with Bitrix\Main\Diag\Logger family (Logger, FileLogger, SysLogger, EventLogger, LogFormatter, JsonLinesFormatter)
  • DI-driven logger integration and support for named loggers (e.g., main.Default, main.HttpClient)
  • Configurability via .settings.php to choose backends, levels, and formatters
  • Monolog compatibility and optional third-party logger integrations for extended workflows

Quick Start

Configure a service to inject a PSR-3 logger and emit a test log entry to verify the integration.

Frequently Asked Questions about bitrix-logger

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement PSR-3 logging in a Bitrix module?

Implement PSR-3 logging in a Bitrix module by injecting PSR-3 compliant loggers through dependency injection. Configure backends, levels, and formatters in .settings.php to standardize log output across modules.

What is the best way to centralize Bitrix log output across multiple integrations?

Centralize Bitrix log output by using named loggers with configurable backends like FileLogger or SysLogger. This unifies debug information across integrations into a standardized PSR-3 format.

Can I use Monolog with Bitrix for structured application logging?

Yes, Bitrix logging supports Monolog compatibility for extended workflows. You can integrate Monolog alongside Bitrix\Main\Diag\Logger to handle structured log formatting and third-party logger integrations.

How do I configure log levels and formatters in Bitrix applications?

Configure log levels and formatters in Bitrix by updating .settings.php. Select specific backends and use LogFormatter or JsonLinesFormatter to control output structure and severity filtering.

Does Bitrix support dependency injection for named loggers like main.HttpClient?

Yes, Bitrix supports DI-driven logger integration for named loggers such as main.Default and main.HttpClient. This allows targeted logging configurations for specific application components.

What backends are available for PSR-3 logging in Bitrix?

Available backends for PSR-3 logging in Bitrix include FileLogger, SysLogger, and EventLogger. These backends integrate with LogFormatter to provide configurable and safe logging practices.