Constants

HOST

HOST = 'logs-01.loggly.com'

ENDPOINT_SINGLE

ENDPOINT_SINGLE = 'inputs'

ENDPOINT_BATCH

ENDPOINT_BATCH = 'bulk'

Properties

$processors

$processors : callable[]

Type

callable[]

$formatter

$formatter : ?\Monolog\Formatter\FormatterInterface

Type

FormatterInterface

$level

$level : int

Type

int

$bubble

$bubble : bool

Type

bool

$curlHandlers

$curlHandlers : resource[]|\CurlHandle[]

Caches the curl handlers for every given endpoint.

Type

CurlHandle[]

$token

$token : string

Type

string

$tag

$tag : string[]

Type

string[]

Methods

handle()

handle(array  $record) : bool

{@inheritDoc}

Parameters

array $record

Returns

bool —

reset()

reset() : void

pushProcessor()

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

{@inheritDoc}

Parameters

callable $callback

Returns

\Monolog\Handler\HandlerInterface —

popProcessor()

popProcessor() : callable

{@inheritDoc}

Returns

callable —

setFormatter()

setFormatter(\Monolog\Formatter\FormatterInterface  $formatter) : \Monolog\Handler\HandlerInterface

{@inheritDoc}

Parameters

\Monolog\Formatter\FormatterInterface $formatter

Returns

\Monolog\Handler\HandlerInterface —

getFormatter()

getFormatter() : \Monolog\Formatter\FormatterInterface

{@inheritDoc}

Returns

\Monolog\Formatter\FormatterInterface —

__construct()

__construct(string  $token, mixed  $level = Logger::DEBUG, bool  $bubble = true) : mixed

Parameters

string $token

API token supplied by Loggly

mixed $level
bool $bubble

Throws

\Monolog\Handler\MissingExtensionException

If the curl extension is missing

Returns

mixed —

isHandling()

isHandling(array  $record) : bool

{@inheritDoc}

Parameters

array $record

Returns

bool —

setLevel()

setLevel(mixed  $level) : self

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

Parameters

mixed $level

Returns

self —

getLevel()

getLevel() : int

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

Returns

int —

setBubble()

setBubble(bool  $bubble) : self

Sets the bubbling behavior.

Parameters

bool $bubble

true means that this handler allows bubbling. false means that bubbling is not permitted.

Returns

self —

getBubble()

getBubble() : bool

Gets the bubbling behavior.

Returns

bool —

true means that this handler allows bubbling. false means that bubbling is not permitted.

handleBatch()

handleBatch(array  $records) : void

Parameters

array $records

close()

close() : void

Closes the handler.

__destruct()

__destruct() : mixed

Returns

mixed —

__sleep()

__sleep() : mixed

Returns

mixed —

setTag()

setTag(string[]|string  $tag) : self

Parameters

string[]|string $tag

Returns

self —

addTag()

addTag(string[]|string  $tag) : self

Parameters

string[]|string $tag

Returns

self —

write()

write(array  $record) : void

Writes the record down to the log of the implementing handler

Parameters

array $record

processRecord()

processRecord(array  $record) : array

Processes a record.

Parameters

array $record

Returns

array —

resetProcessors()

resetProcessors() : void

getDefaultFormatter()

getDefaultFormatter() : \Monolog\Formatter\FormatterInterface

Returns

\Monolog\Formatter\FormatterInterface —

getCurlHandler()

getCurlHandler(string  $endpoint) : resource|\CurlHandle

Loads and returns the shared curl handler for the given endpoint.

Parameters

string $endpoint

Returns

resource|\CurlHandle —

send()

send(string  $data, string  $endpoint) : void

Parameters

string $data
string $endpoint

loadCurlHandle()

loadCurlHandle(string  $endpoint) : resource|\CurlHandle

Starts a fresh curl session for the given endpoint and returns its handler.

Parameters

string $endpoint

Returns

resource|\CurlHandle —