Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logging to bitrix24 #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Resident234
Copy link

@Resident234 Resident234 commented May 25, 2018

Added handlers for logging to Bitrix24.

Bitrix24BlogpostHandler - logging to stream http://prntscr.com/jmj8p5
Bitrix24UserHandler - send notifications to user http://prntscr.com/jmj9kr
Bitrix24ChatHandler - send messages to public/private chats http://prntscr.com/jmjbcm

Example settings:

                'Bitrix24HandlerToChat' => array( //messages to chat
                    'class' => '\Bex\Monolog\Handler\Bitrix24\Bitrix24ChatHandler',
                    'level' => 'DEBUG',
                    'application_scope' => ["pull", "pull_channel", "messageservice", "log", "user", "im"],
                    'application_id' => 'local.5b069ff1a87c76.09******',
                    'application_secret' => 'T3zZKGS1717OKxzDumLo2hKyS******',
                    'domain' => 'b24-******.bitrix24.ru',
                    'chat_id' => 1,
                    'user_id' => 1,
                    'system' => "Y",//Y | N
                    'user_login' => "logger@bitrix24.ru",//account of user, on behalf of which messages will be sent
                    'user_password' => "****"
                ),
                'Bitrix24HandlerToUser' => array( //notifications to user
                    'class' => '\Bex\Monolog\Handler\Bitrix24\Bitrix24UserHandler',
                    'level' => 'DEBUG',
                    'application_scope' => ["pull", "pull_channel", "messageservice", "log", "user", "im"],
                    'application_id' => 'local.5b069ff******',
                    'application_secret' => 'T3zZKGS1717OKxzDumLo******',
                    'domain' => 'b24-******.bitrix24.ru',
                    'user_id' => 1,//send message to this user
                    'notify_type' => 'SYSTEM',// USER | SYSTEM
                    'user_login' => "logger@bitrix24.ru",//account of user, on behalf of which messages will be sent
                    'user_password' => "****"
                ),
                'Bitrix24HandlerToBlogpost' => array( //messages to stream
                    'class' => '\Bex\Monolog\Handler\Bitrix24\Bitrix24BlogpostHandler',
                    'level' => 'DEBUG',
                    'application_scope' => ["pull", "pull_channel", "messageservice", "log", "user", "im"],
                    'application_id' => 'local.5b069ff1a8******',
                    'application_secret' => 'T3zZKGS1717OKxzDumLo2hKySnA******',
                    'domain' => 'b24-******.bitrix24.ru',
                    'perm' => array("U" => array("U1", "UA")),
                    'user_login' => "logger@bitrix24.ru",//account of user, on behalf of which messages will be sent
                    'user_password' => "****"
                ),

For currect workind this handlers needed "mesilov/bitrix24-php-sdk" with accepted pull-requests : mesilov/bitrix24-php-sdk#112 and mesilov/bitrix24-php-sdk#111

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant