Filter out irrelevant messages

Created on 20 August 2019, over 5 years ago
Updated 14 December 2024, 7 days ago

I have used the module in production for years, but we have a problem with the module that I would like to solve:

My problem is that there are some messages we don't want the module to email, even though they are in fact error/warnings.

The most typical messages that I don't want the module to mail:

1) Any access denied messages (channel = "access denied")

2) Any page not found massages (channel = "page not found")

3) Users going to malformed URL's. These are more tricky, they will contain context variables like:

$context['%type'] = 'InvalidArgumentException'
$context['@message'] = 'The user-entered string 'node/3227' must begin with a '/', '?', or '#'.'

Proposed solution:

Add the ability to filter out messages on certain context criteria by adding an extra tab to the configuration page, see wireframe here:
https://docs.google.com/drawings/d/1VgycU6TeiKjg4ZYKReCJdEPy9BY5ciJ2WSOR...

Is this the way to go? And @abu-zakham do you think we should let this into the module or should I make my own module for this? I will be able to control it using hook_mail_alter() without having to change the emaillog module.

✨ Feature request
Status

Needs work

Version

2.1

Component

Code

Created by

πŸ‡©πŸ‡°Denmark bjaxelsen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΈπŸ‡°Slovakia poker10

    The patch no longer applies to latest 2.1.x-dev. Please create a MR when updating the patch.

    Also this change should be in a separate issue, as it is not related and it is a bug:

    diff --git a/emaillog/emaillog.module b/emaillog/emaillog.module
    index 9a36f3a..526c116 100644
    --- a/emaillog/emaillog.module
    +++ b/emaillog/emaillog.module
    @@ -137,6 +137,7 @@ function template_preprocess_emaillog(&$variables) {
    +  $variables['log']['type'] = $variables['log']['variables']['channel'];
    

    The same applies for this unrelated change:

    diff --git a/emaillog/src/Form/EmaillogConfigForm.php b/emaillog/src/Form/EmaillogConfigForm.php
    index 6734a43..b4b61c9 100644
    --- a/emaillog/src/Form/EmaillogConfigForm.php
    +++ b/emaillog/src/Form/EmaillogConfigForm.php
    @@ -136,7 +136,7 @@ class EmaillogConfigForm extends ConfigFormBase {
    -      '#value' => 'Save Configuration',
    +      '#value' => $this->t('Save Configuration'),
    

    Thanks!

  • πŸ‡ΈπŸ‡°Slovakia poker10

    Re: for the two unrelated changes, I have already created issues and fixed them (credited @bjaxelsen):
    πŸ› template_preprocess_emaillog is missing type Active
    πŸ› Fix translation of strings in EmaillogConfigForm Active

    Another thing, which should be considered here is, if we should remove the existing hook - that does not seems ideal from the BC point of view.

Production build 0.71.5 2024