Supabase Log Monitoring with LogMonitor
>_ why supabase apps need log monitoring
Supabase Edge Functions and database triggers generate logs that are hard to access and search in the Supabase dashboard. When issues arise in your Edge Functions or database operations, you need real-time visibility to debug quickly. LogMonitor streams your Supabase application logs to a Live Console with filtering and structured search.
>_ how logmonitor works with supabase
For Supabase Edge Functions running on Deno, use the LogMonitor HTTP API to send logs via fetch. For Node.js-based backends that connect to Supabase, use the logmonitor-js SDK. The SDK auto-patches console.log, console.info, console.warn, console.error, and console.debug. Logs are only sent in production (when process.env.NODE_ENV === 'production'). Both approaches send logs to your LogMonitor Live Console in real time.
>_ quick start
import { serve } from "https://deno.land/std/http/server.ts";const LOGMONITOR_URL = "https://api.logmonitor.io/v1/logs";const API_KEY = Deno.env.get("LOGMONITOR_API_KEY")!;async function sendLog(level: string, message: string) { await fetch(LOGMONITOR_URL, { method: "POST", headers: { "X-Logmonitor-Api-Key": API_KEY, "Content-Type": "application/json" }, body: JSON.stringify([{ level, message, clientTimestamp: Math.floor(Date.now() / 1000) }]), }); // Returns 202 Accepted on success}serve(async (req) => { const body = await req.json(); await sendLog("info", "Edge function invoked"); return new Response(JSON.stringify({ ok: true }), { headers: { "Content-Type": "application/json" } });});>_ what you can monitor
- $Edge Function invocation errors and timeouts
- $Database query and RPC call failures
- $Authentication and RLS policy errors
- $Realtime subscription issues
- $Storage bucket operation failures
- $Webhook processing logs
>_ frequently asked questions
Yes. Supabase Edge Functions run on Deno, which supports the standard fetch API. Use it to send logs to the LogMonitor HTTP API endpoint directly from your Edge Functions.
Yes, if your backend is a Node.js application that connects to Supabase as a database. For Deno-based Edge Functions, use the HTTP API with fetch instead.
Use Supabase Secrets to store your LogMonitor API key. Run supabase secrets set LOGMONITOR_API_KEY=your-key and access it with Deno.env.get() in your function.
Yes. If you use database webhooks or Edge Functions triggered by database events, add LogMonitor logging inside those handlers to capture the trigger context and any errors.
For client-side logging, use the logmonitor-js SDK in your frontend application. It captures console calls automatically and works alongside the Supabase client library.