protected function tryLog($msg, $tries = 0)
    {
        if ((bool)@fwrite($this->stream, $msg))
            return;

        if (0 < $tries)
        {
            trigger_error(sprintf('%s - Unable to log message: "%s"', get_called_class(), $tries, $msg));
            return;
        }

        $this->attemptStreamRecovery();

        $this->tryLog($msg, ++$tries);
    }
protected function tryLog($msg, $tries = 0)
    {
        if ((bool)@fwrite($this->stream, $msg))
            return;

        if (0 < $tries)
        {
            trigger_error(sprintf('%s - Unable to log message: "%s"', get_called_class(), $tries, $msg));
            return;
        }

        $this->attemptStreamRecovery();

        $this->tryLog($msg, ++$tries);
    }
protected function tryLog ( $ msg , $ tries = 0 ) { if ( ( bool ) @ fwrite ( $ this -> stream , $ msg ) ) return ; if ( 0 < $ tries ) { trigger_error ( sprintf ( '%s - Unable to log message: "%s"' , get_called_class ( ) , $ tries , $ msg ) ) ; return ; } $ this -> attemptStreamRecovery ( ) ; $ this -> tryLog ( $ msg , ++ $ tries ) ; }
tryLog will attempt to write output to local stream.  If unable, will kick-off re-open attempt

@param string $msg
@param int $tries
tryLog will attempt to write output to local stream . If unable will kick - off re - open attempt