Ready to be ported
Important NOTE:
Some rules may look like they failed but this is expected behaviour. If you have 2 rules on entity insert on different bundles they will both be triggered when you insert a node but only the right bundle will have success.
Problem/Motivation
Often I'm forced to add all these watchdog loggers to be able to check if a rule or an action has been fired.
Many of the rules and action are fired on CRON runs or triggered on REST requests and routes.
Proposed resolution
Have a sub-module with an custom entity much similar to watchdog and trasfer the data from business_rules to this and display it with dbug styling when visited.
Remaining tasks
Generate sub-module with drupal consoleGenerate entity to sub-module with drupal consoleAdd general fields to entityAdd serialized data fieldAdd API to log data#3076276: Integrate br_logs with business_rulesProcess all required data from business_rules into br_logsAdd views UI and settingsIntegrate dbug into log entity display
User interface changes
Logs are located at: /admin/reports/br_log
Enable the logging in /admin/config/workflow/business_rules/settings
Issues
Fixed:
Infinite loop:
When I integrate the services of br_logs into business_rules I get an infinte loop, this behavior does not happen on dpm() or watchdog.


Please read the README.txt for more details located in br_logs sub-module.
API
---
// Information to be stored with the log.
$fields = [
'description' => $rule_data['#description'],
'items' => $rule_items,
'rule_status' => $rule_status,
'variables' => $variables,
];
// Call br_logs service
\Drupal::service('br_logs')
->rulesLogger($type = $rule_id, $rule_data['#title'], $rule_data, $fields);
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | br_logs_to_d10-3075401-17.patch | 42.05 KB | vrwired |
| #16 | br_logs_to_d10-307540116.patch | 42.05 KB | vrwired |
| #12 | br_logs_submodule-3075401-12.patch | 42.02 KB | lexsoft00 |
Comments
Comment #2
c.e.a commentedSounds great!
Comment #3
lexsoft00 commentedComment #4
lexsoft00 commentedComment #5
lexsoft00 commentedComment #6
lexsoft00 commentedComment #7
lexsoft00 commentedComment #8
lexsoft00 commentedComment #9
lexsoft00 commentedComment #10
lexsoft00 commentedComment #11
lexsoft00 commentedComment #12
lexsoft00 commentedbr_logs
Note: This includes the patch from Integrate br_logs with business_rules
Comment #13
lexsoft00 commentedComment #14
lexsoft00 commentedComment #15
lexsoft00 commentedComment #16
vrwired commentedFor those who still use this module, I've update patch from #12 for D10 compatibility.
Comment #17
vrwired commentedHad typo in last patch's name, this fixes it