Stores to any socket - uses fsockopen() or pfsockopen().

public __construct(string $connectionString, $level = 100, bool $bubble = true)
    public Monolog\Handler\Handler::__destruct()
    public Monolog\Handler\Handler::__sleep()
    public close() : void

    We will not close a PersistentSocket instance so it can be reused in other requests.

    public closeSocket() : void

    Close socket, if open

    public Monolog\Handler\AbstractHandler::getBubble() : bool

    Gets the bubbling behavior.

    • return bool true means that this handler allows bubbling. false means that bubbling is not permitted.
    public getChunkSize() : int

    Get current chunk size

    public getConnectionString() : string

    Get current connection string

    public getConnectionTimeout() : float

    Get current connection timeout setting

    public Monolog\Handler\AbstractProcessingHandler::getFormatter() : Monolog\Formatter\FormatterInterface


    public Monolog\Handler\AbstractHandler::getLevel() : int

    Gets minimum logging level at which this handler will be triggered.

    • return int
    public getTimeout() : float

    Get current in-transfer timeout

    public getWritingTimeout() : float

    Get current local writing timeout

    • return float
    public Monolog\Handler\AbstractProcessingHandler::handle(array $record) : bool


    public Monolog\Handler\Handler::handleBatch(array $records) : void


    public isConnected() : bool

    Check to see if the socket is currently available.

    UDP might appear to be connected but might fail when writing. See for details.

    public Monolog\Handler\AbstractHandler::isHandling(array $record) : bool


    public isPersistent() : bool

    Get persistent setting

    public Monolog\Handler\AbstractProcessingHandler::popProcessor() : callable


    public Monolog\Handler\AbstractProcessingHandler::pushProcessor(callable $callback) : Monolog\Handler\HandlerInterface


    • suppress PhanTypeMismatchReturn
    public Monolog\Handler\AbstractProcessingHandler::reset()
    public Monolog\Handler\AbstractHandler::setBubble(bool $bubble) : self

    Sets the bubbling behavior.

    • return self
    public setChunkSize(int $bytes) : self

    Set chunk size. Only has effect during connection in the writing cycle.

    public setConnectionTimeout(float $seconds) : self

    Set connection timeout. Only has effect before we connect.

    • see
    public Monolog\Handler\AbstractProcessingHandler::setFormatter(Monolog\Formatter\FormatterInterface $formatter) : Monolog\Handler\HandlerInterface


    • suppress PhanTypeMismatchReturn
    public Monolog\Handler\AbstractHandler::setLevel( $level) : self

    Sets minimum logging level at which this handler will be triggered.

    • return self
    public setPersistent(bool $persistent) : self

    Set socket connection to be persistent. It only has effect before the connection is initiated.

    public setTimeout(float $seconds) : self

    Set write timeout. Only has effect before we connect.

    • see
    public setWritingTimeout(float $seconds) : self

    Set writing timeout. Only has effect during connection in the writing cycle.

      protected Monolog\Handler\AbstractHandler::$bubble
      protected Monolog\Handler\AbstractProcessingHandler::$formatter
      • var FormatterInterface
      protected Monolog\Handler\AbstractHandler::$level
      protected Monolog\Handler\AbstractProcessingHandler::$processors
      • var callable[]
      protected fsockopen()

      Wrapper to allow mocking

      protected fwrite( $data)

      Wrapper to allow mocking

      protected generateDataStream(array $record) : string
      protected Monolog\Handler\AbstractProcessingHandler::getDefaultFormatter() : Monolog\Formatter\FormatterInterface

      Gets the default formatter.

      Overwrite this if the LineFormatter is not a good default for your handler.

      protected getResource()
      • return resource|null
      protected pfsockopen()

      Wrapper to allow mocking

      protected Monolog\Handler\AbstractProcessingHandler::processRecord(array $record) : array

      Processes a record.

      protected Monolog\Handler\AbstractProcessingHandler::resetProcessors() : void
      protected streamGetMetadata()

      Wrapper to allow mocking

      protected streamSetChunkSize()

      Wrapper to allow mocking

      • see
      protected streamSetTimeout()

      Wrapper to allow mocking

      • see
      protected write(array $record) : void

      Connect (if necessary) and write to the socket

      • throws UnexpectedValueException
      • throws RuntimeException
      private $chunkSize
      • var int
      private $connectionString
      private $connectionTimeout
      private $errno
      private $errstr
      private $lastSentBytes
      private $lastWritingAt
      private $persistent
      private $resource
      • var resource|null
      private $timeout
      • var float
      private $writingTimeout
      • var float
      private connect() : void
      private connectIfNotConnected()
      private createSocketResource() : void
      private setSocketTimeout() : void
      private setStreamChunkSize() : void
      private validateTimeout( $value)
      private writeToSocket(string $data) : void
      private writingIsTimedOut(int $sent) : bool
      © 2020 Bruce Wells
      Search Namespaces \ Classes
      ConfigurationNumbers (0-9.) only