PHPackages                             magify/magento2-module-slacknotifier - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. magify/magento2-module-slacknotifier

ActiveMagento2-module[Logging &amp; Monitoring](/categories/logging)

magify/magento2-module-slacknotifier
====================================

This Magento 2 module automatically sends every logger exception to a specified Slack channel.

1.0.0(1y ago)11272[1 issues](https://github.com/HamzaHannad/Magento2-SlackLogger/issues)MITPHPPHP &gt;=7.4

Since Jul 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/HamzaHannad/Magento2-SlackLogger)[ Packagist](https://packagist.org/packages/magify/magento2-module-slacknotifier)[ RSS](/packages/magify-magento2-module-slacknotifier/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

Magento 2 Slack Notifier Module
===============================

[](#magento-2-slack-notifier-module)

Overview
--------

[](#overview)

The Magento 2 Slack Notifier module sends logger exceptions automatically to a specified Slack channel. This integration helps you stay updated with critical issues in your Magento store by sending real-time notifications directly to your Slack workspace.

Features
--------

[](#features)

- Sends logger exceptions to a Slack channel
- Configurable log levels (Alert, Debug, Critical, Info, Error, Emergency, Notice, Warning)
- Option to use synchronous or asynchronous sending
- Custom message service to send messages to specified channels with async/sync options (for developers)

Installation
------------

[](#installation)

### Using Composer

[](#using-composer)

1. Navigate to your Magento 2 root directory.
2. Require the module using Composer: ```
    composer require magify/magento2-module-slacknotifier
    ```
3. Enable the module: ```
    php bin/magento module:enable Magify_SlackNotifier
    ```
4. Run the setup upgrade command: ```
    php bin/magento setup:upgrade
    ```

Configuration
-------------

[](#configuration)

1. In the Magento admin panel, navigate to `Stores > Configuration > Advanced > Developer > Slack Notifier`.
2. Configure the following settings:

    - **Activate**: Enable or disable the Slack notifier module.
    - **Use Async Send**: Select whether to send messages asynchronously or synchronously.
    - **API Timeout**: Set the timeout duration in seconds for API calls. Use 0 for an indefinite wait.
    - **Logger Type**: Select the log types to send to Slack (e.g., Alert, Debug, Critical, etc.).
    - **URL**: The Slack API URL. Typically, this will be `https://slack.com/api/chat.postMessage`.
    - **Channel ID**: The ID of the Slack channel where messages will be sent.
    - **Token**: Your Slack app token.

Usage
-----

[](#usage)

Once configured, the module will automatically send log exceptions of the specified types to your Slack channel. You can monitor these notifications to quickly respond to issues in your Magento store.

Custom Message Service
----------------------

[](#custom-message-service)

### Overview

[](#overview-1)

The custom message service allows developers to send any message to a specified Slack channel, with the option to choose between asynchronous or synchronous sending.

### Note

[](#note)

If the channel and token are not set in the function parameters, the service will use the values configured in the Magento admin panel.

### Usage

[](#usage-1)

Here is an example of how to use the custom message service in your Magento 2 module:

1. Inject the `CustomMessage` in your class:

    ```
