\Monolog\FormatterFluentdFormatter

Class FluentdFormatter

Serializes a log message to Fluentd unix socket protocol

Fluentd config:

type unix path /var/run/td-agent/td-agent.sock

Monolog setup:

$logger = new Monolog\Logger('fluent.tag'); $fluentHandler = new Monolog\Handler\SocketHandler('unix:///var/run/td-agent/td-agent.sock'); $fluentHandler->setFormatter(new Monolog\Formatter\FluentdFormatter()); $logger->pushHandler($fluentHandler);

Summary

Methods
Properties
Constants
__construct()
isUsingLevelsInTag()
format()
formatBatch()
No public properties found
No constants found
No protected methods found
$levelTag
N/A
No private methods found
No private properties found
N/A

Properties

$levelTag

$levelTag : boolean

Type

boolean — should message level be a part of the fluentd tag

Methods

__construct()

__construct(  $levelTag = false) 

Parameters

$levelTag

isUsingLevelsInTag()

isUsingLevelsInTag() 

format()

format(array  $record) : mixed

Formats a log record.

Parameters

array $record

A record to format

Returns

mixed —

The formatted record

formatBatch()

formatBatch(array  $records) : mixed

Formats a set of log records.

Parameters

array $records

A set of records to format

Returns

mixed —

The formatted set of records