Skip to content

This is a simple package that allow a PHP script to send real time logs to Slack.

License

Notifications You must be signed in to change notification settings

mathieuimbert/slack-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

slack-logger

Packagist

Latest Stable Version Latest Unstable Version Total Downloads License

Unit Tests

Build Status Coverage Status

Code Quality

SensioLabsInsight

Description

This is a simple package that allow a PHP script to send real time logs to Slack.

Please be aware that the repository is still in an early phase, and every new commit might not be backward compatible.

Installation

Installation of Slack Logger is done using Composer.

composer require mathieuimbert/slack-logger

Usage

$logger = new \MathieuImbert\Slack\Logger\SlackLogger('https://hooks.slack.com/services/xxxxxxx/xxxxxxx/xxxxxxx');
$logger->warning('This a not test of the emergency broadcast system, this is the real thing');

Options

You can customize the name and the icon of your logger in the incoming webhook configuration, or you can do it from SlackLogger by passing the right options to he constructor:

$logger = new \MathieuImbert\SlackLogger\SlackLogger(
    'https://hooks.slack.com/services/xxxxxxx/xxxxxxx/xxxxxxx',
    array('username' => 'My Slack Logger', 'icon_emoji' => ':cop:')
);

About

This is a simple package that allow a PHP script to send real time logs to Slack.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages