PHP code example of drupol / drupal7_psr3_watchdog

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

    

drupol / drupal7_psr3_watchdog example snippets


function HOOK_init() {
  // Make sure to load the autoload.php, there are multiple way to do that.
  // is is an alert message.');
  $logger->critical('This is a critical message.');
  $logger->debug('This is a debug message.');
  $logger->emergency('This is an emergency message.');
  $logger->error('This is an error message.');
  $logger->info('This is an info message.');
  $logger->notice('This is a notice message.');
  $logger->warning('This is a warning message.');
  }  

  // Make sure to load the autoload.php, there are multiple way to do that.
  //  the handler
  $logger->pushHandler(new \drupol\drupal7_psr3_watchdog\Handler\Drupal7Watchdog());

  $logger->alert('This is an alert message.');
  $logger->critical('This is a critical message.');
  $logger->debug('This is a debug message.');
  $logger->emergency('This is an emergency message.');
  $logger->error('This is an error message.');
  $logger->info('This is an info message.');
  $logger->notice('This is a notice message.');
  $logger->warning('This is a warning message.');  
  }

  $logger->alert('This is an {type} message.', array('type' => 'ALERT'));

  $logger->warning('This is a {type} message.', array('type' => 'WARNING', 'link' => '<a href="https://github.com/">Github</a>'));