predanie/bitrix24-monolog-bundle

Allows you send errors to a bitrix24 chat using a webhook integration

1.0.2 2018-11-13 13:22 UTC

This package is auto-updated.

Last update: 2024-06-14 01:55:41 UTC


README

Installation

Install using Composer:

./composer require predanie/bitrix24-monolog-bundle

This version was tested with a project based on symfony 3.4.

Add the bundle to your AppKernel.php:

$bundles = array(
    //...
    new Predanie\Bitrix24Bundle\PredanieBitrix24MonologBundle(),
    //...
);

Create a monolog.yml file using current path app/config/bitrix24/monolog.yml and include it to the config_prod.yml file:

imports:
    - { resource: bitrix24/monolog.yml }

Add bitrix24 handler and configure it:

monolog:
    handlers:
        bitrix24:
            type: service
            id: predanie.bitrix24_monolog_handler

predanie_bitrix24_monolog:
    chat_id: '%bitrix24_chat_id%'
    user_id: '%bitrix24_user_id%'
    webhook: '%bitrix24_webhook%'

Add parameters to your parameters.yml:

    bitrix24_chat_id: 1 # your bitrix24 chat for logging
    bitrix24_user_id: 1 # user id who send messages to bitrix24 chat 
    bitrix24_webhook: xxxxxxxxxxxxxx # Weebhook code - need to create in the Bitrix24 admin panel

Enjoy!

P.S.: if you need send some custom exceptions just call the bitrix24 manager.

DefaultController.php example:

    $this->get('predanie.bitrix24_manager')->imMessageAdd($e->getMessage());