1.x Mattermost Logger

Created on 14 March 2025, about 1 month ago

Link to module: https://www.drupal.org/project/mattermost_logger
D10/D11

This module integrates with Mattermost to log messages from the Drupal logging system.
Choose which logging channels to send to Mattermost and set the logging levels for each channel.

Features

  • Hooks into Drupal's logger service.
  • Supports multiple logging channels.
  • Configurable logging levels per channel.
  • Allows setting a unique webhook per channel or default to a default webhook.
  • Displays messages with color-coded indicators in Mattermost.

Configuration

  • Navigate to /admin/config/services/mattermost-logger/settings.
  • Add Drupal logging channels and their corresponding webhooks.
  • Select the logging levels for each channel.

The module automatically logs messages to mattermost based on the configured channels and levels.

Developers can use the MattermostLogger service manually (Make sure to set a default mattermost webhook in the config):

\Drupal::service('mattermost_logger')->error('my_module', 'My error message');
📌 Task
Status

Needs review

Component

module

Created by

🇳🇱Netherlands emiel_bloem

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

Comments & Activities

  • Issue created by @emiel_bloem
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    Thank you for applying!

    Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.

    The important notes are the following.

    • If you have not done it yet, enable GitLab CI for the project, and fix what reported from the phpcs job. This help to fix most of what reviewers would report.
    • For the time this application is open, only your commits are allowed. No other people, including other maintainers/co-maintainers can make commits.
    • The purpose of this application is giving you a new drupal.org role that allows you to opt projects into security advisory coverage, either projects you already created, or projects you will create. The project status won't be changed by this application.
    • Nobody else will get the permission to opt projects into security advisory policy. If there are other maintainers/co-maintainers who will to get that permission, they need to apply with a different module.
    • We only accept an application per user. If you change your mind about the project to use for this application, or it is necessary to use a different project for the application, please update the issue summary with the link to the correct project and the issue title with the project name and the branch to review.

    To the reviewers

    Please read How to review security advisory coverage applications , Application workflow , What to cover in an application review , and Tools to use for reviews .

    The important notes are the following.

    • It is preferable to wait for a Code Review Administrator before commenting on newly created applications. Code Review Administrators will do some preliminary checks that are necessary before any change on the project files is suggested.
    • Reviewers should show the output of a CLI tool only once per application. The configuration used for these tools needs to be the same configuration used by GitLab CI, stored in the GitLab Templates repository.
    • It may be best to have the applicant fix things before further review.

    For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues .

  • 🇪🇸Spain alvarodemendoza

    Fix phpcs issues.

    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml mattermost_logger-1.x/*
    
    FILE: mattermost_logger-1.x/README.md
    ----------------------------------------------------------------------
    FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
    ----------------------------------------------------------------------
      3 | WARNING | Line exceeds 80 characters; contains 95 characters
      4 | WARNING | Line exceeds 80 characters; contains 96 characters
     22 | WARNING | Line exceeds 80 characters; contains 85 characters
     26 | WARNING | Line exceeds 80 characters; contains 82 characters
    ----------------------------------------------------------------------
    
    FILE: mattermost_logger-1.x/src/MattermostLogger.php
    -------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------------------
     9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Logger\LoggerChannelTrait.
    -------------------------------------------------------------------------------------------------------------------------------

    Remember to change status, when the project is ready to be reviewed. In this queue, projects are only reviewed when the status is Needs review.

  • 🇳🇱Netherlands emiel_bloem

    Fixed phpcs

  • 🇮🇳India vishal.kadam Mumbai

    1. FILE: README.md

    The README file is missing the required sections , including Requirements and Installation.

    2. FILE: mattermost_logger.info.yml

    package: Custom

    This line is used by custom modules created for specific sites. It is not a package name used for projects hosted on drupal.org.

  • 🇳🇱Netherlands emiel_bloem

    Thank you for the feedback! I overlooked these points.

    For point 1 (README.md):
    - Added the Requirements and Installation sections.

    For point 2 (mattermost_logger.info.yml):
    - Changed package to Logging.

    The changes are in this commit: 88bbcc1f.

    Let me know if anything else needs adjustment. Thanks again!

  • 🇮🇳India vishal.kadam Mumbai

    Rest looks fine to me.

    Let’s wait for a Code Review Administrator to take a look and if everything goes fine, you will get the role.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    Thank you for your contribution and for your patience with the review process!

    I am going to update your account so you can opt into security advisory coverage any project you create, including the projects you already created.

    These are some recommended readings to help you with maintainership:

    You can find more contributors chatting on Slack or IRC in #drupal-contribute. So, come hang out and stay involved !
    Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review . I encourage you to learn more about that process and join the group of reviewers.

    I thank the dedicated reviewers as well.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇳🇱Netherlands emiel_bloem

    Thank you @avpaderno !

Production build 0.71.5 2024