Beginner

Set Up Slack Alerts for Production Errors

Create a LogFlow alert that pings your Slack channel whenever the error rate exceeds a threshold — set up in under 5 minutes, no code required.

LogFlow TeamApr 15, 20265 minAlertsSlack

Getting a Slack ping when something breaks in production is one of the highest-value things you can set up. This tutorial walks through creating a LogFlow alert that fires when error rate exceeds 5% over a 5-minute window.

Prerequisites

  • Logs flowing into LogFlow (see the Quick Start guide)
  • A Slack workspace where you can create a webhook

Step 1 — Create a Slack incoming webhook

  1. Go to api.slack.com/apps and click Create New App → From scratch
  2. Name it "LogFlow Alerts", pick your workspace
  3. In the left sidebar, click Incoming Webhooks → toggle it On
  4. Click Add New Webhook to Workspace → select the #alerts channel (or create one)
  5. Copy the webhook URL — it looks like https://hooks.slack.com/services/T.../B.../xxx

Step 2 — Create the alert in LogFlow

Open LogFlow → Alerts and click New Alert.

Fill in the form:

Condition

  • Type: Error rate above
  • Threshold: 5 (percent)
  • Window: 5 minutes

Channel

  • Type: Slack
  • Webhook URL: paste your Slack webhook URL from Step 1

Settings

  • Name: High error rate
  • Cooldown: 30 minutes (prevents repeated pings during an ongoing incident)

Click Create Alert.

Step 3 — Test it

The fastest way to test: send a few error logs via the CLI or the HTTP API, then check your Slack channel.

# Send a test error via HTTP API
curl -X POST https://api.getlogflow.com/v1/logs \
  -H "Authorization: Bearer lf_your_key" \
  -H "Content-Type: application/json" \
  -d '{"level":"error","message":"Payment failed","service":"api"}'

Alternatively, trigger errors in your application and watch for the Slack message.

What the Slack message looks like

When the alert fires, LogFlow posts a message to your channel:

🚨 Alert: High error rate Error rate is 8.3% (threshold: 5%) in the last 5 minutes. Service: api · Project: My App View logs →

Other alert types worth setting up

While you're here, consider adding these:

Alert type When to use
Keyword match Fire when a specific string appears ("database connection failed")
Log count above Fire when request volume spikes unexpectedly
Level spike Fire when fatal logs appear (any count)
Anomaly detection Automatic — fires when LogFlow detects unusual patterns

All support the same channels: Slack, Telegram, email, Discord, or any webhook.

FAQ

What is the cooldown period? After an alert fires, LogFlow waits for the cooldown period before firing again — even if the condition is still true. This prevents your Slack channel from being spammed during a long outage. 30 minutes is a good default.

Can I alert on a specific service only? Currently alerts apply to your whole project. Filter in the Logs Explorer and create separate projects per critical service if you need per-service alerting.

What if I want to alert on Telegram instead? The setup is identical — choose Telegram as the channel type and provide your bot token and chat ID. See Alerts documentation for all channel types.

Start monitoring your logs today

Free plan available. No credit card required. Up and running in 2 minutes.

Get started free