bitrix-logger

Installation
SKILL.md

Logging (PSR-3)

Baseline: main 23.0+ · Verified: main 26.800.0

Code depends on Psr\Log\LoggerInterface; the implementation is chosen in .settings.php loggers. AddMessage2Log() — compat only.

Implementations (Bitrix\Main\Diag\)

Class Notes
FileLogger(string $fileName, ?int $maxSize = null) default max 1 MB, then renamed to <file>.old; 0 = no rotation
SysLogger(string $prefix = '', int $flags = LOG_ODELAY, int $facility = LOG_USER) system syslog
EventLogger(?string $module, ?string $auditType, ?callable $callback) b_event_log (Event log in admin) — low volume only
LogFormatter($showArguments = false, $argMaxChars = 30) default; placeholders {date} {host} {level} {delimiter} {exception} {trace} + context keys
JsonLinesFormatter (Since main 25.300; older: LogFormatter) writes only $context as one JSON line — the message text is dropped, put it into context

level and formatter settings apply only to Bitrix\Main\Diag\Logger subclasses, not to Monolog.

Get a logger

Installs
295
GitHub Stars
48
First Seen
Jul 16, 2026