Properties

$processors

$processors : callable[]

Type

callable[]

$formatter

$formatter : ?\Monolog\Formatter\FormatterInterface

Type

FormatterInterface

$level

$level : int

Type

int

$bubble

$bubble : bool

Type

bool

$webhookUrl

$webhookUrl : string

Slack Webhook token

Type

string

$slackRecord

$slackRecord : \Monolog\Handler\Slack\SlackRecord

Instance of the SlackRecord util class preparing data for Slack API.

Type

SlackRecord

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

Parameters

\Monolog\Formatter\FormatterInterface $formatter

Returns

\Monolog\Handler\HandlerInterface —

getFormatter()

getFormatter() : \Monolog\Formatter\FormatterInterface

Returns

\Monolog\Formatter\FormatterInterface —

__construct()

__construct(string  $webhookUrl, string|null  $channel = null, string|null  $username = null, bool  $useAttachment = true, string|null  $iconEmoji = null, bool  $useShortAttachment = false, bool  $includeContextAndExtra = false, mixed  $level = Logger::CRITICAL, bool  $bubble = true, string[]  $excludeFields = array()) : mixed

Parameters

string $webhookUrl

Slack Webhook URL

string|null $channel

Slack channel (encoded ID or name)

string|null $username

Name of a bot

bool $useAttachment

Whether the message should be added to Slack as attachment (plain text otherwise)

string|null $iconEmoji

The emoji name to use (or null)

bool $useShortAttachment

Whether the the context/extra messages added to Slack as attachments are in a short style

bool $includeContextAndExtra

Whether the attachment should include context and extra data

mixed $level
bool $bubble
string[] $excludeFields

Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2']

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

Handles a set of records at once.

Parameters

array $records

The records to handle (an array of record arrays)

close()

close() : void

Closes the handler.

__destruct()

__destruct() : mixed

Returns

mixed —

__sleep()

__sleep() : mixed

Returns

mixed —

getSlackRecord()

getSlackRecord() : \Monolog\Handler\Slack\SlackRecord

Returns

\Monolog\Handler\Slack\SlackRecord —

getWebhookUrl()

getWebhookUrl() : string

Returns

string —

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

Gets the default formatter.

Overwrite this if the LineFormatter is not a good default for your handler.

Returns

\Monolog\Formatter\FormatterInterface —