PHP Class GELFMessagePublisher, gelf-php

Afficher le fichier Open project: graylog2/gelf-php Class Usage Examples

Protected Properties

Свойство Type Description
$chunkSize integer
$hostname string
$port integer
$streamSocketClient resource

Méthodes publiques

Méthode Description
__construct ( string $hostname, integer $port = self::GRAYLOG2_DEFAULT_PORT, integer $chunkSize = self::CHUNK_SIZE_WAN ) Creates a new publisher that sends errors to a Graylog2 server via UDP
publish ( GELFMessage $message ) : boolean Publishes a GELFMessage, returns false if an error occured during write

Méthodes protégées

Méthode Description
getMessageChunks ( string $preparedMessage ) : array
getMessageId ( ) : float
getPreparedMessage ( GELFMessage $message ) : string
getSocketConnection ( ) : resource
isMessageSizeGreaterChunkSize ( string $preparedMessage ) : boolean
prependChunkInformation ( float $messageId, string $data, integer $sequence, integer $sequenceSize ) : string
writeMessageChunkToSocket ( resource $socket, float $messageId, string $messageChunk, integer $messageChunkIndex, integer $messageChunksCount ) : integer | boolean
writeMessageToSocket ( resource $socket, string $preparedMessage ) : integer | boolean

Method Details

__construct() public méthode

Creates a new publisher that sends errors to a Graylog2 server via UDP
public __construct ( string $hostname, integer $port = self::GRAYLOG2_DEFAULT_PORT, integer $chunkSize = self::CHUNK_SIZE_WAN )
$hostname string
$port integer
$chunkSize integer

getMessageChunks() protected méthode

protected getMessageChunks ( string $preparedMessage ) : array
$preparedMessage string
Résultat array

getMessageId() protected méthode

protected getMessageId ( ) : float
Résultat float

getPreparedMessage() protected méthode

protected getPreparedMessage ( GELFMessage $message ) : string
$message GELFMessage
Résultat string

getSocketConnection() protected méthode

protected getSocketConnection ( ) : resource
Résultat resource

isMessageSizeGreaterChunkSize() protected méthode

protected isMessageSizeGreaterChunkSize ( string $preparedMessage ) : boolean
$preparedMessage string
Résultat boolean

prependChunkInformation() protected méthode

protected prependChunkInformation ( float $messageId, string $data, integer $sequence, integer $sequenceSize ) : string
$messageId float
$data string
$sequence integer
$sequenceSize integer
Résultat string

publish() public méthode

Publishes a GELFMessage, returns false if an error occured during write
public publish ( GELFMessage $message ) : boolean
$message GELFMessage
Résultat boolean

writeMessageChunkToSocket() protected méthode

protected writeMessageChunkToSocket ( resource $socket, float $messageId, string $messageChunk, integer $messageChunkIndex, integer $messageChunksCount ) : integer | boolean
$socket resource
$messageId float
$messageChunk string
$messageChunkIndex integer
$messageChunksCount integer
Résultat integer | boolean

writeMessageToSocket() protected méthode

protected writeMessageToSocket ( resource $socket, string $preparedMessage ) : integer | boolean
$socket resource
$preparedMessage string
Résultat integer | boolean

Property Details

$chunkSize protected_oe property

protected int $chunkSize
Résultat integer

$hostname protected_oe property

protected string $hostname
Résultat string

$port protected_oe property

protected int $port
Résultat integer

$streamSocketClient protected_oe property

protected resource $streamSocketClient
Résultat resource