View on GitHub


A log4php appender build as wrapper for "maknz/slack" package

Download this project as a .zip file Download this project as a tar.gz file

Slack as appender for log4php


Dependency Status Latest Stable Version Total Downloads Latest Unstable Version License

Monthly Downloads Daily Downloads

Master Branch

Build Status StyleCI Coverage Status

Develop Branch

Build Status StyleCI Coverage Status


This package allows you to use Slack for PHP easily and elegantly in your app as an log4php appender. Read the instructions below to get it set up.


PHP >= 5.2 || ^7.0


You can install the package using the Composer package manager. You can install it by running this command in your project root:

composer require fahl-design/log4php-slack-appender

Then create an incoming webhook for each Slack team you'd like to send messages to. You'll need the webhook URL(s) in order to configure this package.

After you got your hook url add it as endpoint to your configuration

XML appender config example

    <log4php:configuration xmlns:log4php="" threshold="all">
        <appender name="default" class="LoggerAppenderSlack">
            <!-- get endpoint url from -->
            <param name="endpoint" value="" />
            <param name="channel" value="#yourChannel" />
            <param name="username" value="Log4php" />
            <param name="icon" value=":ghost:" />
        <logger name="myLogger">
            <appender_ref ref="default" />
            <level value="DEBUG" />

php (config.php) appender config example

    return [
        'rootLogger' => [
            'appenders' => ['default'],
        'myLogger' => [
            'appenders' => ['default'],
        'appenders' => [
            'default' => [
                'class' => 'LoggerAppenderSlack',
                'params' => [
                    'endpoint' => '',
                    'channel' => '#yourChannel',
                    'username' => 'log4php',
                    'icon' => ':ghost:', // emoji or an icon url


Check example (src/examples)


$logger = Logger::getLogger('myLogger');
$logger->debug('Hello World!');