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.

Comments

mfb created an issue. See original summary.

andypost’s picture

Looks good++

Not clear why no tests affected

mfb’s picture

Log level seems almost too trivial to test, but I'll add a test if needed :)

andypost’s picture

Status: Needs review » Reviewed & tested by the community

Let's get commiter's POV

Status: Reviewed & tested by the community » Needs work

The last submitted patch, node-log-level.patch, failed testing. View results

mfb’s picture

Status: Needs work » Reviewed & tested by the community

Unrelated failure, back to RTBC

Status: Reviewed & tested by the community » Needs work

The last submitted patch, node-log-level.patch, failed testing. View results

mfb’s picture

Status: Needs work » Reviewed & tested by the community

Another unrelated failure, it looks like

quietone’s picture

Version: 9.4.x-dev » 10.0.x-dev
Status: Reviewed & tested by the community » Needs work

Moving to 10.0.x where it needs to be applied first.

I applied the patch locally and ran git grep this\-\>logger\(\'content and 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.

mfb’s picture

Title: Demote routine node log entries from "notice" to "info" » Demote routine node and book log entries from "notice" to "info"
Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new4.58 KB
new702 bytes

Status: Needs review » Needs work

The last submitted patch, 10: node-log-level-10.patch, failed testing. View results

mfb’s picture

Status: Needs work » Needs review

Seems to have been an unrelated JS failure

andrea.cividini’s picture

+1, tested and reviewed patch #10 on Drupal 9.4.5

mfb’s picture

Version: 10.0.x-dev » 10.1.x-dev
Issue summary: View changes
mfb’s picture

Issue summary: View changes
ameymudras’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new281.82 KB
new265.17 KB

Tested #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

xjm’s picture

Title: Demote routine node and book log entries from "notice" to "info" » Demote routine content entity log entries from "notice" to "info"
Status: Reviewed & tested by the community » Needs work

Thanks 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:

[ayrton:drupal | Sun 17:20:51] $ grep -rl 'logger->notice' * | grep -v "vendor" | grep -v "node_modules"
core/lib/Drupal/Core/File/FileSystem.php
core/lib/Drupal/Core/Action/Plugin/Action/EmailAction.php
core/modules/migrate_drupal/src/FieldDiscovery.php
core/modules/contact/src/MailHandler.php
core/modules/locale/locale.bulk.inc
core/modules/locale/locale.module
core/modules/locale/locale.batch.inc
core/modules/comment/src/CommentTypeForm.php
core/modules/comment/src/CommentForm.php
core/modules/user/user.module
core/modules/user/src/EventSubscriber/UserFloodSubscriber.php
core/modules/block_content/src/BlockContentForm.php
core/modules/block_content/src/BlockContentTypeForm.php
core/modules/workspaces/src/Form/WorkspaceForm.php
core/modules/image/src/Controller/ImageStyleDownloadController.php
core/modules/search/src/Controller/SearchController.php
core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Desaturate.php
core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Rotate.php
core/modules/rest/src/Plugin/rest/resource/EntityResource.php
core/modules/media/src/MediaForm.php

From that list:

  1. User was already reviewed
  2. Comments, block content, book content, and media notices should be reviewed and handled in this issue
  3. The instance in core/lib/Drupal/Core/File/FileSystem.php should be kept as a notice.
  4. The mail handling operations in core/lib/Drupal/Core/Action/Plugin/Action/EmailAction.php and core/modules/contact/src/MailHandler.php might merit being downgraded to info messages, but are a different kind of thing, so could get their own issue scope.
  5. The REST POST case should probably be considered in a separate issue, although it's interesting that there's no equivalent JSON:API POST message.
  6. Worspaces are more than simply content so probably should be considered separately.
  7. Locale can have its own issue.
  8. The instances in core/modules/image/src/Controller/ImageStyleDownloadController.php, core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Desaturate.php, and core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Rotate.php should all be kept as notices.
  9. The search module message should probably also be downgraded, but can be discussed on its own.

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.

mfb’s picture

Status: Needs work » Needs review
StatusFileSize
new1.55 KB
new6.35 KB
xjm’s picture

Adding credit for the duplicates.

xjm’s picture

Status: Needs review » Needs work
Issue tags: +Needs change record updates

The additional messages would need to be added to the CR.

mfb’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new4.06 KB
new11.07 KB

#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.

mfb’s picture

Updated the change record

mfb’s picture

Issue summary: View changes

Fixed link to change record in release notes.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Change 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.

  • catch committed cee80c4e on 10.1.x
    Issue #3255699 by mfb, xjm, andrea.cividini, quietone, smustgrave:...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 10.1.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

kristen pol’s picture

Was 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.

andypost’s picture

Why there's no follow-up for taxonomy and media?

mfb’s picture

@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.