Problem/Motivation

Various routine events, such as creating a term or posting a comment, 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

Proposed resolution

Demote log level from "notice" to "info" for the following events:

  • Send email action
  • Comment posted
  • Comment deleted
  • Email sent via contact form
  • Email sent via user contact form
  • Searched
  • Term created
  • Term updated

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Log level changes

Some routine events 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.

CommentFileSizeAuthor
#9 3381078.patch2.45 KBmfb
demote-notice.patch5.73 KBmfb

Comments

mfb created an issue. See original summary.

andypost’s picture

Status: Needs review » Needs work

As I see media and user using notice
- \Drupal\media\MediaForm::save()
- \Drupal\media\MediaTypeForm::save()
- \Drupal\user\Form\UserCancelForm::submitForm()
- \Drupal\user\RegisterForm::save()

probably there's more and I bet it needs change record

mfb’s picture

Issue summary: View changes
Status: Needs work » Needs review

Added change record draft and release notes snippet. @andypost I'm not proposing further changes to user and media logging at this time, because we already updated those modules to log routine events as "info" and more significant events as "notice". Certainly if there is consensus though, more log level updates can be added to this issue.

andypost’s picture

Status: Needs review » Reviewed & tested by the community

Thank you, makes sense. I find it ready

quietone’s picture

Status: Reviewed & tested by the community » Needs work

Thanks for continuing to improve the log levels!

I'm triaging RTBC issues.

I read the IS and comments and was wondering if there was a Meta or some other discussion where these changes were agreed to. I found #3255699: Demote routine content entity log entries from "notice" to "info" and read the IS and comments over there. In particular is comment #17 where this task for all of core was scoped. And it turns out that that the patch over there was not modified in response. The same is true for this issue, it is using a different scope than recommended by a core committer.

There may be reasons for that change, and if there are, they should be commented to allow discussion. I also recommend making a Meta from comment #17so that it easier to follow the changes and to ensure that all the messages are changed. It would also allow others to pick up a piece of this task.

I read that xjm recommends only one change record. That is a good idea but only when the commits are to the same branch. Also, when there is a new CR, like in this issue, it should have a different name than the previous one to avoid confusion. I would go so far as to say the CR from the other issue should have a title change to reflect which kinds of messages are demoted. But I haven't checked to see if that would make the title too long.

Because of the scoping I am setting this back to NW.

mfb’s picture

Status: Needs work » Needs review

@quietone I'm unclear what scope you are proposing. For example, we could split this issue into 5 issues: One for email action, one for comment posting and deleting, one for contact emails, one for search, and one for taxonomy create and update. Maybe that's too much issue overhead, or does that sound reasonable?

quietone’s picture

@mfb, I am referring to the scoping set out by xjm in comment 17 of the current parent issue, #3255699-17: Demote routine content entity log entries from "notice" to "info".

mfb’s picture

@quietone ok, that doesn't mention taxonomy so I kinda have to extrapolate. How about splitting this into 3 issues: one for email action and contact emails, one for comment post/delete and taxonomy create/update (since those are both content entities), and one for search? My take would be that this is not worth splitting into multiple issues, but *shrug* whatever's easier.

mfb’s picture

Title: Demote routine log entries from "notice" to "info" » Demote routine content entity log events from "notice" to "info" (round 2)
Issue summary: View changes
StatusFileSize
new2.45 KB

Split off two child issues: #3384429: Demote email log events from "notice" to "info" and #3384425: Demote search log events from "notice" to "info" and rerolled with just the content entity related hunks.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Split from main issue looks good

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 9: 3381078.patch, failed testing. View results

smustgrave’s picture

Status: Needs work » Reviewed & tested by the community

Seems unrelated.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 9: 3381078.patch, failed testing. View results

smustgrave’s picture

Status: Needs work » Reviewed & tested by the community

Seems random again

xjm’s picture

Status: Reviewed & tested by the community » Needs work

This looks great. However, instead of creating a new CR, can we just attach https://www.drupal.org/node/3381101 and update it to include the changes from this issue? Thanks!

smustgrave’s picture

@xjm may be late but I don't follow, the attached link is to this CR. So not sure whats meant by

can we just attach https://www.drupal.org/node/3381101 and update it to include the changes from this issu
xjm’s picture

Status: Needs work » Reviewed & tested by the community

lol my bad. Don't mix sleep medication and the RTBC queue, folks.

xjm’s picture

Status: Reviewed & tested by the community » Needs work

Oh that said I would like other issues to be added to the scope. All the "Demote notice..." issues should be merged into one unless there are like 50+ such reductions.

mfb’s picture

Title: Demote routine content entity log events from "notice" to "info" (round 2) » Demote routine log events from "notice" to "info"
Issue summary: View changes
Status: Needs work » Needs review

Lol ok restoring the initial patch, issue summary and title

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @mfb for closing those others out.

mfb’s picture

Issue summary: View changes

Fixed typo in issue summary

xjm’s picture

Ahhh I see what happened. The key phrase from #3255699-17: Demote routine content entity log entries from "notice" to "info" is:

If we need to split it up

In this case, its size and change pattern did not merit being split up. It's truly impressive that I managed to write a 3000-word comment and still did not manage to get the key point across. 😅 It is explained in the scope doc I linked, but in reality it's a lot of info to process.

The key considerations are the size of the changeset in added plus removed lines, and whether the changes can be scanned and reviewed without context. If you need to look beyond the changed lines to get the context, smaller scopes are better. For example, adding return typehints or documentation requires reading an entire method as well as looking at all its callers and parent or sibling or child methods, so small scopes are best for that.

If something is scannable, with each change following an identical pattern, and only requires a git diff --color-words to validate, and the total scope of potential changes is already documented along the lines of my comment from the other issue, it's safe to have at least 100-200 total lines to review (50 to 100 one-line changes).

The only times we would split up a "no context required color-words issue" would be:

  • If it were mixing different patterns of otherwise scannable changes
  • If it were more than 300-400 lines (150-200 one-line changes)
  • If parts were patch-eligible and other parts were minor-only
  • f there were interdependencies with other issues
  • If there were merge conflicts with prioritized issues.

Edit: reformatted for readability.

If you want to learn more about why these details of scoping are important, the video of my DDD Vienna session on code review explains the psychology behind all this. 🙂

xjm’s picture

Priority: Minor » Normal
Issue tags: +Needs followup

Ohh, on the CR front, I meant adding them to the previous CR in https://www.drupal.org/node/3259469/edit. I updated that CR to include this issue and its changes, and deleted the new draft.

Crediting @mfb for patch work, @smustgrave for helping re: the CRs, and @quietone and @andypost for asking scope questions.

Is there a separate followup for the media events @andypost suggested? If exists and is RTBC-ish, it can also be included here. If not, we should file it. Thanks!

Promoting to normal; "minor" should only be used for nitpicks. This change improves the UX of watchdog, so it's not a nothing-change.

xjm’s picture

Status: Reviewed & tested by the community » Needs work

Oh, and NW until the followup is either filed or merged into this issue.

mfb’s picture

Status: Needs work » Needs review

As I mentioned in #3 I am not proposing further changes to Media logging

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs followup

Removing follow up tag.

  • xjm committed 9c025861 on 11.x
    Issue #3381078 by mfb, smustgrave, xjm, quietone, andypost: Demote...

  • xjm committed 2a71397e on 10.2.x
    Issue #3381078 by mfb, smustgrave, xjm, quietone, andypost: Demote...
xjm’s picture

Status: Reviewed & tested by the community » Fixed

OK, sounds good!

Committed to 11.x and cherry-picked to 10.2.x. Since this is a behavior change for things in the admin UI, I was on the fence about backporting it to a patch release. I checked the previous issue and it was not backported past 10.1.x, so I followed the same pattern here.

Thanks everyone!

needs-review-queue-bot’s picture

Status: Fixed » Needs work

The Needs Review Queue Bot tested this issue.

While you are making the above changes, we recommend that you convert this patch to a merge request. Merge requests are preferred over patches. Be sure to hide the old patch files as well. (Converting an issue to a merge request without other contributions to the issue will not receive credit.)

nod_’s picture

Status: Needs work » Fixed
xjm’s picture

Version: 11.x-dev » 10.2.x-dev

Status: Fixed » Closed (fixed)

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