Custom User Action Logging Setup for 1C-Bitrix
On projects with 200+ content managers and administrators, the question "who changed the price on this product yesterday at 17:30?" remains unanswered without proper logging. The built-in Bitrix event log records far from everything, and what it records is stored without convenient filtering. For example, you won't know who unpublished a product or changed its name. Without detailed auditing, it's impossible to prove a specific employee's action or restore the change history. We solve this: we configure comprehensive logging with custom handlers, rotation, and archiving. Having completed over 50 Bitrix projects, we guarantee transparency for every action. Our engineers develop handlers for infoblocks, orders, and CRM, add diff comparison, and customizable filters. Contact us — we'll select the optimal logging configuration for your project.
Why the built-in event log is insufficient
Bitrix writes events out of the box into the b_event_log table. It is enabled in the main module settings: Settings → Product Settings → Module Settings → Main Module → "Event Log" tab.
Standard logged events:
- Login/logout (
USER_LOGIN,USER_LOGOUT) - Login failures (
USER_LOGIN_FAILED) - Module rights changes (
MODULE_RIGHTS_CHANGED) - File operations via file manager (
FILE_DELETE,FILE_EDIT) - User operations (
USER_ADD,USER_EDIT,USER_DELETE)
These events cover only system actions. Content changes — products, articles, prices — stay out of sight. Without custom handlers, you remain blind to most modifications.
The following remain outside standard configuration:
- Infoblock element changes (products, articles, news) — key gap
- Order changes (status updates, editing)
- Price and stock changes
- CRM module actions (contacts, deals, leads)
On commercial projects, these are exactly the changes that most often require auditing. Our custom solution is three times more effective than the standard one because it adds diff comparison and flexible filters. Records are stored with exact time, IP address, and user session.
How to extend logging via event handlers
For logging infoblock changes, subscribe to the iblock module events:
-
OnBeforeIBlockElementUpdate— get data BEFORE change -
OnAfterIBlockElementUpdate— record the fact of change
Both events are needed to record a diff — which fields changed and from which values to which. The handler is registered in /local/php_interface/init.php via AddEventHandler() or in the module's events.php file. Below are key fields to log:
| Field | Why log |
|---|---|
| NAME | Product renaming |
| ACTIVE | Enable/disable |
| SORT | Sort order change |
| PROPERTY_PRICE / PRICE | Price change |
| PROPERTY_* | Any infoblock property |
| DETAIL_TEXT | Description change |
For recording, use CEventLog::Add():
CEventLog::Add([ 'SEVERITY' => 'INFO', 'AUDIT_TYPE_ID' => 'IBLOCK_ELEMENT_UPDATE', 'MODULE_ID' => 'iblock', 'ITEM_ID' => $elementId, 'DESCRIPTION' => json_encode([ 'user_id' => $GLOBALS['USER']->GetID(), 'changes' => $diff, ], JSON_UNESCAPED_UNICODE), ]); Records go into the same b_event_log table and are visible in the standard event log interface.
Complete handler code example for infoblocks
AddEventHandler("iblock", "OnBeforeIBlockElementUpdate", "MyLogIBlockBeforeUpdate"); AddEventHandler("iblock", "OnAfterIBlockElementUpdate", "MyLogIBlockAfterUpdate"); // ... rest of code How to configure order action logging
The sale module has its own events: OnSaleOrderSaved, OnSaleStatusOrder, OnSalePayOrder. For full order audit, we subscribe to OnSaleOrderSaved — it fires on every order save. Inside the handler, we access the \Bitrix\Sale\Order object to get the current state. For comparison with the previous state, we load the order from the database before save (in OnBeforeSaleOrderSaved). This captures all changes: status, composition, delivery address, prices.
Rotation and storage
The b_event_log table grows quickly. On an active store (1000+ orders/day, 50+ editors) — up to 100,000 records per month. Rotation settings:
- Retention time — set in event log settings (unlimited by default)
- Manual cleanup —
CEventLog::CleanUp($days)via agent - Recommendation — keep 90 days in Bitrix, archive older records to a separate table or file
Optimal storage configuration:
| Data type | Retention | Archiving method |
|---|---|---|
| Active records | 90 days | Remain in b_event_log |
| Old records | Up to 1 year | Copied to archive table b_event_log_archive |
| Archive | Unlimited | Export to CSV and remove from DB |
What is included in logging setup
We provide a complete package:
- Development of custom handlers for infoblocks, orders, and CRM
- Configuration of rotation and archiving
- Testing on test data with creation of reference records
- Documentation on journal access and filtering
- Delivery of handler source code
- Training for administrators on working with the journal
- 30-day support after delivery
Quick verification of configuration
After attaching handlers: modify a test product in admin panel, then open Settings → Tools → Event Log, filter by type IBLOCK_ELEMENT_UPDATE. The record should contain the element ID and a diff of changes in the description.
Basic logging setup takes one business day. Get a consultation on logging configuration today. Contact us — we will help set up logging to any requirements. Achieve transparency and control over all actions on your Bitrix project.
For more details on the event log, see the official Bitrix documentation: Event Log

