Componette

Componette

manweCZ

manweCZ / tracy-slack-logger v0.6.1

Slack integration for Tracy debugger (uses Slack Webhook integration)

download-cloud-line composer require biteit/tracy-slack-logger

Quick integration for Tracy Debugging panel for Slack.

Installation:

  1. Create a webhook integration for you Slack team here: https://my.slack.com/services/new/incoming-webhook/
  2. Initialize TracySlackLogger
$logger = new \BiteIT\TracySlackLogger('YOUR_HOOK_URL');
\Tracy\Debugger::$productionMode = true;
\Tracy\Debugger::setLogger( $logger );

Now whenever an error or exception occures on your website, your selected Slack Channel will be notified.

If you want to customize what log priorities should be notified to your Slack Channel, use the method

$logger->setReportingLevels( [ ILogger::INFO ] );

If you want to report ALL priorities, use an empty array for the method. By default, the TracySlackLogger notifies ILogger::ERROR, ILogger::CRITICAL and ILogger::EXCEPTION errors.

If you want to enable or disable advanced information in slack message you can use these methods.

$logger->setEnabledMessageData([\BiteIT\TracySlackLogger::MESSAGE_ALL]);
$logger->setDisabledMessageData(\BiteIT\TracySlackLogger::MESSAGE_IP);

If you want to add custom data to your messages, you can do so by using custom messages callback (added in v 0.5). Message will be inserted before error description.

$logger->addCustomMessageCallback(function() use ($myDependencies){
    return "*Logged user*: {$myDependencies->getLoggedUser()->getName()}";
});
  • v0.6.1 0.6.1

    • added limit for maximum errors sent
    • added http(s) for title
  • v0.6 0.6

    • added limit on maximum number of errors sent to slack
  • v0.5.1 0.5.1

    fixed tracy dependency to allow newer versions

  • 0.5 0.5

    Added custom messages

  • 0.4.3

  • 0.4.2

  • 0.4.1 0.4.1 - Adding advanced message data

    Adding advanced message data

  • 0.4.0

  • 0.1

bar-chart-fill

Statistics

download-cloud-fill
13298
star-fill
3
bug-fill
0
flashlight-fill
309d
price-tag-2-line

Badges

guide-fill

Dependencies

tracy/tracy (^2.4.10)
php (>=5.6.0)
Componette Componette felix@nette.org