2017 © Pedro Peláez
 

library tracy-slack-logger

Integrates Tracy Logger to your Slack

image

biteit/tracy-slack-logger

Integrates Tracy Logger to your Slack

  • Friday, February 2, 2018
  • by manweCZ
  • Repository
  • 0 Watchers
  • 0 Stars
  • 118 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 33 % Grown

The README.md

Quick integration for Tracy Debugging panel for Slack., (*1)

Installation: 1. Create a webhook integration for you Slack team here: https://my.slack.com/services/new/incoming-webhook/ 2. Initialize TracySlackLogger, (*2)

$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., (*3)

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

$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., (*5)

If you want to enable or disable advanced information in slack message you can use these methods., (*6)

$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., (*7)

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

The Versions

02/02 2018

dev-master

9999999-dev

Integrates Tracy Logger to your Slack

  Sources   Download

MIT

The Requires