anchor.diff: +:source-highlighter: pygments
  +
   = Simplogger: Simple PHP logging utility
   
   == Overview
  
positive.code: deployed, but can just as easily use stdout/stderr (e.g. in the
  development environment).
  
    require('Simplogger.php');
    $ident = basename($argv[0]);
    $opts = getopt('s', ['syslog']);
    $logger = array_key_exists('s', $opts) || array_key_exists('syslog', $opts)
      ? new \Simplogger\SyslogLogger($ident, LOG_CONS, LOG_LOCAL1) 
      : new \Simplogger\StdoutLogger;
    $logger->notice('Hello world!');
  
  == Setup
  
  Copy `Simplogger.php` to a directory of your choice and import it.
  
    require('Simplogger.php');
  
  === Log to local syslog
  
    $ident = 'my-program-name';
    $facility = LOG_LOCAL1;
    $options = LOG_CONS | LOG_PID;
    $logger = new \Simplogger\SyslogLogger($ident, $options, $facility);
  
  `SyslogLogger` logs using PHP's `http://php.net/manual/en/function.syslog.php[syslog()]`
  function, and parameters are the same as passed to
  
negative.code: 
  === Log to remote syslogd via UDP
  
  [source,php]
  ----
  $syslogHost = 192.0.2.22;
  $syslogPort = 514;
  $logger = new \Simplogger\RemoteSysLogger($ident, $facility, $syslogHost, $syslogPort);
  ----
  
  `RemoteSysLogger` sends all messages to syslogd over UDP.
  Default host is `127.0.0.1`, default port number is 514.
  
  === Log to stdout/stderr
  
  [source,php]
  ----
  $logger = new \Simplogger\StdoutLogger;
  ----
  
  `StdoutLogger` writes all messages to stdout.
  
  