Skip to content

Use Monolog with Slack #514

@thangngoc89

Description

@thangngoc89

I am using Laravel 5 and I have some issues with Slack Handler integration.
I set up a ChromePHP Handler and It works perfectly so I assume there is no problems with Laravel.

This is the way I set up Slack Handler

$monolog = Log::getMonolog();

$monolog->pushHandler($chromeHandler = new \Monolog\Handler\ChromePHPHandler());
$chromeHandler->setFormatter(new \Monolog\Formatter\ChromePHPFormatter());

$slackHandler = new \Monolog\Handler\SlackHandler('my-api-token', 'general');
$monolog->pushHandler($slackHandler);
$slackHandler->setFormatter(new \Monolog\Formatter\LineFormatter());

I get my api token from https://api.slack.com/web#auth.
Is there anything wrong with my config?
At the same time, ChromePHP works and Slack doesn't work.
I really can't make Monolog work with Slack.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions