Skip to content

nikonm/monolog-mattermost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Monolog Mattermost Handler

Build Status Latest Stable Version Total Downloads

This Handler may be useful if you need send log messages to Mattermost channels, it's very easy to setup and integrate in your application if you are using Monolog.

Sample

<?php

use Monolog\Logger;
use NikonM\Monolog\MattermostWebhookHandler;

$url = 'ssl://mattermost.yourcompany.com:443/hooks/<your-hook-token>';//PORT is Required
$options = [
    'username' => 'logger-user',
    'icon_url' => 'http://icons-for-free.com/icon/download-alien_icon-367307.png'
];

// Create the logger
$logger = new Logger('my_logger');
$logger->pushHandler(new MattermostWebhookHandler($url, $options, Logger::DEBUG));

// You can now use your logger
$logger->info('My logger is now ready');