Guides / Monitoring
Smart Actions supports a Webhook action type. When the threshold is crossed, LogIt sends a POST request to any URL you configure — including Slack's incoming webhook endpoint.
https://hooks.slack.com/services/T.../B.../...Make sure you're logging events with a consistent name that the Smart Action will match:
await logit.now("payments", {
event: "Payment failed",
description: `${customer.email} — ${error.message}`,
icon: "❌",
notify: false,
tags: { currency: charge.currency },
metadata: { customerId: customer.id, amount: charge.amount },
});
In Dashboard → Smart Actions, create a new rule:
| Field | Value |
|---|---|
| Name | Payment failure spike → Slack |
| Channel | payments |
| Event name | Payment failed |
| Threshold | 3 |
| Window | 10 minutes |
| Cooldown | 30 minutes |
| Action | Webhook |
| URL | Your Slack webhook URL |
LogIt sends a POST with a JSON body that Slack renders as a message in your channel.
{
"text": "🔔 Smart Action triggered: Payment failure spike → Slack",
"attachments": [{
"color": "#e53e3e",
"fields": [
{ "title": "Rule", "value": "Payment failure spike → Slack", "short": true },
{ "title": "Event count", "value": "3", "short": true },
{ "title": "Channel", "value": "payments", "short": true },
{ "title": "Window", "value": "10 minutes", "short": true }
]
}]
}
Try LogIt free
7-day trial. No credit card required.