PHP code example of port-adhoc / papertrail

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

    

port-adhoc / papertrail example snippets




use PortAdhoc\Papertrail;

Papertrail::host('example.papertrailapp.com')
  ->port(123456)
  ->facility(99)
  ->program('cron')
  ->component('spam-cleaning')
  ->message('hello world')
  ->severity( Papertrail::SEVERITY_DEBUG )
  ->send();



use PortAdhoc\Papertrail;

Papertrail::host('example.papertrailapp.com')
  ->port(123456)
  ->facility(99)
  ->program('cron')
  ->component('spam-cleaning');

// a few moments later

Papertrail::message('fetching table done')
  ->severity( Papertrail::SEVERITY_DEBUG )
  ->send();

// an eternity later

Papertrail::message('cleaning table done')
  ->severity( Papertrail::SEVERITY_DEBUG )
  ->send();