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);

CloneableInstantiable
ImplementsMonolog\Formatter\FormatterInterface
Methods
public __construct(bool $levelTag = false)
public format(array $record) : string
public formatBatch(array $records) : string
public isUsingLevelsInTag() : bool
Properties
protected $levelTag
 
  • var bool $levelTag should message level be a part of the fluentd tag
© 2020 Bruce Wells
Search Namespaces \ Classes
ConfigurationNumbers (0-9.) only