PHP code example of biteit / tracy-slack-logger

1. Go to this page and download the library: Download biteit/tracy-slack-logger library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

biteit / tracy-slack-logger example snippets


$logger = new \BiteIT\TracySlackLogger('YOUR_HOOK_URL');
\Tracy\Debugger::$productionMode = true;
\Tracy\Debugger::setLogger( $logger );

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

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

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