During debugging I found it helpful to log information to the watchdog.
While there is a event for adding watchdog entries, I did not find a corresponding action so I created one.
My use case for this was in the case where a rule was triggered by an external callback request. There was no page request, or drush command, so there was nowhere to show a system message. Putting a message in the log seemed like the more sensible approach.
I hope it's helpful.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 2681761-6.patch | 3.31 KB | tr |
| #4 | rules_watchdog-2681761-4.patch | 2.19 KB | darksnow |
| rules-watchdog_log-7.x.patch | 1.67 KB | darksnow |
Comments
Comment #2
darksnowComment #3
shabana.navas commentedHope this gets committed asap. As it's extremely useful.
Comment #4
darksnowRevisiting this for the first time in a long time and the patch I supplied for this incomplete.
I'll attach one that actually works.
Comment #5
tr commentedYour patch adds 2 coding standards errors. See the test result in #4. The patch doesn't have to fix the coding standards errors that already exist - those should be handled in a separate coding standards issue - but we really shouldn't be introducing NEW errors.
Comment #6
tr commentedHere is a new patch with the aforementioned coding standards fixes.
Comment #7
tr commentedComment #8
jonathan1055 commentedThis has been worked on before at 7.x
#1349882: Action: Create a watchdog entry
#2170013: Provide system action to write a db watchdog message
Need to make sure we use the best from all of these these patches.
Comment #9
tr commentedActually the patch in #2170013: Provide system action to write a db watchdog message is much preferable to the one here, and is better than the one in #1349882: Action: Create a watchdog entry.
Neither has tests however, and neither addresses the comments from @fago in[#1349882-20].
I'm going to close this as a duplicate of #1349882: Action: Create a watchdog entry.
Comment #10
tr commented