This issue is to:
- Rename
logger.channel.rulestologger.channel.rules_debug - Rename the implementation of this service,
RulesLoggerChannel, toRulesDebugLoggerChannel - Ensure all places in the codebase and tests that were using the former
logger.channel.ruleare re-written to uselogger.channel.rules_debugAND that these usages are really intended to log to the debug channel (in-memory logs) and NOT meant to log to the core Drupal dblog (database logs). - Go through the entire D7 codebase and find all the places where
rules_log()was used. Make sure that all those uses (actions/conditions, expressions etc.) are ported to D8 using the newlogger.channel.rules_debug. (This is being handled by #3103959: Port all D7 uses of rules_log() to the D8 logging system)
As outlined in the parent issue, we need a D8 replacement for the D7 rules_log() function, which was used to send messages to the Rules debug logger (and optionally forward them to the core dblog, controlled by Rules system variables).
It turns out that we already pretty much have this, but it was named RulesLoggerChannel which is deceptive and inaccurate. Deceptive because logger channels in Drupal are, in general, meant to correspond to the old D7 log message 'type', so the normal RulesLoggerChannel would be expected to send logs of type 'rules' to the core Drupal dblog where they would be written to the database. This is the usage practiced everywhere else in Drupal. But that's not what our RulesLoggerChannel does, which is why it is an inaccurate name.
Thus our rules_log() replacement in D8 should be:
/** @var \Drupal\rules\Logger\RulesDebugLoggerChannel $rulesDebugLoggerChannel */
$rulesDebugLoggerChannel = \Drupal::service('logger.channel.rules_debug');
$rulesDebugLoggerChannel->log();| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3101194-5-rules-debug-logger-channel.patch | 23.2 KB | tr |
| #4 | 3101194-4-rules-debug-logger-channel.patch | 22.47 KB | tr |
| #2 | 3101194-2-rules-debug-logger-channel.patch | 22.47 KB | tr |
Comments
Comment #2
tr commentedI think this covers most of 1-3 above. But not 4). In addition, I also defined the new
logger.channel.rulesand injected it into the RulesDebugLoggerChannel because that will be needed in #3101198: [meta] Implement conditional logging and on-screen rendering in RulesDebugLoggingChannel and I wrote this patch before I had separated the issues so I don't want to undo those changes.Comment #3
tr commentedComment #4
tr commentedTypo.
Comment #5
tr commentedAgain.
Comment #7
tr commentedCommitted #5. I think between this and #3101199-3: Create a new rules logger channel for logging things to the database we've covered steps 1, 2, and 3.
Leaving open for step 4, which is going to be a big one as most of that stuff was left out of D8 entirely.
Comment #8
tr commentedI've moved step 4 to its own issue, #3103959: Port all D7 uses of rules_log() to the D8 logging system, because it involved a lot of work that I want to separate from this current very simple task.
As the remainder of this issue is fixed and committed, I'm closing this issue.