PHP code example of abgit / timber

1. Go to this page and download the library: Download abgit/timber 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/ */

    

abgit / timber example snippets




// import dependencies
ance
$timber = new timber\log( YOUR_SOURCE_ID, YOUR_SOURCE_APIKEY );

// Add messages
$timber->warning( 'some warning message' )
       ->error( 'some error message' )
       ->info( 'some info message' )
       ->debug( 'some debug message' );

// Send messages to timber
$timber->send(); 

// Add messages with custom tags
$timber->warning( 'some warning message', [ 'extrainfo' => 2 ] )
       ->error( 'some error message', [ 'otherinfo' => 4 ] )

// Send messages to timber
$timber->send(); 

// Add messages with custom tags and custom unixtimestamp
$timber->error( 'some error message', [ 'extrainfo' => 2, 'otherinfo' => 4 ], time() - 86400 )

// Send messages to timber
$timber->send();