PHP code example of khalyomede / syslog-interface

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

    

khalyomede / syslog-interface example snippets


class MyLog implements SyslogInterface {
  // ...
}

$log = new MyLog;

$log->warning('Request invalidated for user {userid}', ['userid' => 'John']);

public function alert(string $message, array $context = []);

public function critical(string $message, array $context = []);

public function date(DateTime $date);

public function debug(string $message, array $context = []);

public function device(string $device);

public function emergency(string $message, array $context = []);

public function error(string $message, array $context = []);

public function facility(int $category);

public function host(string $host);

public function identifier(string $identifier);

public function info(string $message, array $context = []);

public function log(string $level, string $message, array $context = []);

public function notice(string $message, array $context = []);

public function port(int $port);

public function processus(string $processus);

public function source(string $source);

public function warning(string $message, array $context = []);