SlackPayloadFormatter class

An ErrorFormatter that produces a Slack Block Kit message payload.

Formats the error record and recent context logs into structured blocks suitable for delivery via a Slack Incoming Webhook.

To obtain a webhook URL, create an Incoming Webhook in your Slack app settings: https://api.slack.com/messaging/webhooks

Example:

final exporter = HttpErrorExporter(
  'https://hooks.slack.com/services/...',
  SlackPayloadFormatter(),
);
Implemented types

Constructors

SlackPayloadFormatter()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

format(LogRecord error, List<LogRecord> contextLogs, Map<String, String> metadata) Map<String, dynamic>
Builds the JSON-encodable payload to deliver to the remote endpoint.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited