Problem/Motivation
Routine content management events, such as creating a node, are logged with the "notice" log level, which is for "normal but significant events." On active sites, these events are not really significant per se, so the lower severity "info" log level, for "interesting events," would be a better fit.
Steps to reproduce
Install node module, create a node, find a notice entry in your database log or syslog.
Proposed resolution
Demote from notice to info:
- Delete node revision
- Revert node revision
- Delete node
- Create node
- Update node
- Update book
Keep as a notice:
- Create node type
Remaining tasks
None
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
Log level changes
Some routine content entity events (this includes book, custom block, media, node and others) which were previously logged as notices are now logged at the lower-severity "info" level. A change record lists which events are now logged at the "info" level.
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | 3255699-21.patch | 11.07 KB | mfb |
| #16 | After.png | 265.17 KB | ameymudras |
| #16 | Before.png | 281.82 KB | ameymudras |
Comments
Comment #2
andypostLooks good++
Not clear why no tests affected
Comment #3
mfbLog level seems almost too trivial to test, but I'll add a test if needed :)
Comment #4
andypostLet's get commiter's POV
Comment #6
mfbUnrelated failure, back to RTBC
Comment #8
mfbAnother unrelated failure, it looks like
Comment #9
quietone commentedMoving to 10.0.x where it needs to be applied first.
I applied the patch locally and ran
git grep this\-\>logger\(\'contentand found that BookAdminEditForm.php logs a notice when the title changes. In this patch when a node title changes an info level message is logged, unless I am reading the patch wrong. I think that needs to be changed. Setting to needs work.Comment #10
mfbComment #12
mfbSeems to have been an unrelated JS failure
Comment #13
andrea.cividini commented+1, tested and reviewed patch #10 on Drupal 9.4.5
Comment #14
mfbComment #15
mfbComment #16
ameymudras commentedTested #10 on Drupal 10.1.x
- The issue summary makes sense and provides the necessary details
- The patch applies cleanly
- The severity changes from notice to info
- Did a code review and there are no noticeable issues
Marking this issue as RTBC
Comment #17
xjmThanks for working on this.
Separating out the User module log messages made sense, because users are not like other content entities; they are associated with an account that has its own privileges on the site. However, for other content entities, I don't think we should be scoping these issues on a per-module basis. That creates unnecessary overhead. Reference:
https://www.drupal.org/docs/develop/issues/issue-procedures-and-etiquett...
I would recommend we make these changes across core consistently for content entity creation, update, etc. events. Certainly, #3309417: Demote routine block log entries from "notice" to "info" can be grouped with this issue, as can anything else performing similar operations on entities. If we need to split it up, it should be by operation, not by the specific entity type.
A quick grep gives the following potential list of modules with affected events:
From that list:
core/lib/Drupal/Core/File/FileSystem.phpshould be kept as a notice.core/lib/Drupal/Core/Action/Plugin/Action/EmailAction.phpandcore/modules/contact/src/MailHandler.phpmight merit being downgraded to info messages, but are a different kind of thing, so could get their own issue scope.core/modules/image/src/Controller/ImageStyleDownloadController.php,core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Desaturate.php, andcore/modules/system/src/Plugin/ImageToolkit/Operation/gd/Rotate.phpshould all be kept as notices.Additionally, we should maintain a single CR about this, rather than creating a ton of tiny ones. So let's use https://www.drupal.org/node/3259469 instead.
Comment #18
mfbMerged in @andrea.cividini's patches from #3309417: Demote routine block log entries from "notice" to "info" and #3309436: Demote routine media log entries from "notice" to "info"
Comment #19
xjmAdding credit for the duplicates.
Comment #20
xjmThe additional messages would need to be added to the CR.
Comment #21
mfb#3309417: Demote routine block log entries from "notice" to "info" and #3309436: Demote routine media log entries from "notice" to "info" didn't fully satisfy their proposed resolutions. We also need to dive into core/lib/Drupal/Core/Entity and demote some more notices to info. See interdiff for the additional demotions.
Comment #22
mfbUpdated the change record
Comment #23
mfbFixed link to change record in release notes.
Comment #24
smustgrave commentedChange record looks good
Issue summary is clear.
Tested out a few scenarios
Deleted a node -> info
Deleted a node revision ->info
Reverted a node revision -> info
Deleted a media -> info
Know there are others but seems all cases were covered.
Comment #26
catchCommitted/pushed to 10.1.x, thanks!
Comment #28
kristen polWas looking at this issue. Not sure why andypost and ameymudras weren't credited for their contribution as they both seemed to contribute IMO but this issue is closed so maybe it won't be changed.
Comment #29
andypostWhy there's no follow-up for taxonomy and media?
Comment #30
mfb@andypost I guess the magic elves who file minor drupal tasks while on their lunch break have been slacking off? This issue included media items, and just filed #3381078: Demote routine log events from "notice" to "info" for taxonomy terms and some others.