Plop
A simple logging library for PHP
Plop\Handler\Datagram Class Reference

An handler that sends log messages to a remote host using UDP datagrams. More...

+ Inheritance diagram for Plop\Handler\Datagram:

Public Member Functions

 __construct ($host, $port)
 
- Public Member Functions inherited from Plop\Handler\Socket
 __construct ($host, $port)
 
 __destruct ()
 Free the resources used by this handler.
 
 getCloseOnError ()
 
 getInitialRetryDelay ()
 
 getMaximumRetryDelay ()
 
 getRetryFactor ()
 
 handleError (\Plop\RecordInterface $record,\Exception $exception)
 
 setCloseOnError ($close)
 
 setInitialRetryDelay ($delay)
 
 setMaximumRetryDelay ($max)
 
 setRetryFactor ($factor)
 
- Public Member Functions inherited from Plop\HandlerAbstract
 __construct (\Plop\FormatterInterface $formatter=null,\Plop\FiltersCollectionAbstract $filters=null)
 
 getFilters ()
 
 getFormatter ()
 
 handle (\Plop\RecordInterface $record)
 
 handleError (\Plop\RecordInterface $record,\Exception $exception)
 
 setFilters (\Plop\FiltersCollectionAbstract $filters)
 
 setFormatter (\Plop\FormatterInterface $formatter)
 

Protected Member Functions

 makeSocket ($timeout=1)
 
- Protected Member Functions inherited from Plop\Handler\Socket
 close ()
 
 createSocket ()
 
 emit (\Plop\RecordInterface $record)
 
 getCurrentTime ()
 
 makePickle (\Plop\RecordInterface $record)
 
 makeSocket ($timeout=1)
 
 send ($s)
 
 write ($s)
 
- Protected Member Functions inherited from Plop\HandlerAbstract
 emit (\Plop\RecordInterface $record)
 
 format (\Plop\RecordInterface $record)
 
 getStderr ()
 

Additional Inherited Members

- Protected Attributes inherited from Plop\Handler\Socket
 $closeOnError
 Whether to close the socket automatically on error.
 
 $host
 Remote host where the logs will be sent.
 
 $port
 Remote port where the logs will be sent.
 
 $retryFactor
 Factor applied to the reconnection delay after a reconnection failure.
 
 $retryMax
 Maximum delay between reconnection attempts.
 
 $retryPeriod
 The delay that will apply to the next reconnection attempt.
 
 $retryStart
 Initial delay for reconnection attempts.
 
 $retryTime
 UNIX timestamp of the next connection attempt, if any.
 
 $socket
 The socket that will be used to send the logs.
 
- Protected Attributes inherited from Plop\HandlerAbstract
 $filters
 An object handling a collection of filters.
 
 $formatter
 Formatter object to use for this handler.
 

Detailed Description

An handler that sends log messages to a remote host using UDP datagrams.

Definition at line 28 of file Datagram.php.

Constructor & Destructor Documentation

Plop\Handler\Datagram::__construct (   $host,
  $port 
)

Construct a new instance of this handler.

Parameters
string$hostThe remote host where the logs will be sent. This may be a (fully qualified) host name or an IP address (v4 or v6).
int$portDestination port where the logs will be sent.

Definition at line 31 of file Datagram.php.

References Plop\Handler\Socket\$host, and Plop\Handler\Socket\$port.

Member Function Documentation

Plop\Handler\Datagram::makeSocket (   $timeout = 1)
protected

Create a new socket.

Parameters
int$timeout(optional) Unused. This parameter exists only for compatibility reasons with the base class (Plop::Handler::Socket).
Return values
resourceThe newly created socket.

Definition at line 50 of file Datagram.php.


The documentation for this class was generated from the following file: