Monitoring and logging help you watch your app and catch problems early. They show what is happening inside your system in real time or after events.
0
0
Monitoring and logging in Supabase
Introduction
You want to know if your Supabase database is running smoothly.
You need to find out why your app crashed or slowed down.
You want to track user actions for security or debugging.
You want alerts when something goes wrong in your backend.
You want to improve your app by analyzing usage patterns.
Syntax
Supabase
supabase logs --project-ref <project_ref> --since <time_period>
--project-ref is your unique Supabase project ID.
--since lets you specify how far back to see logs, like '1h' for one hour.
Examples
Shows logs from the last 30 minutes for project 'abc123'.
Supabase
supabase logs --project-ref abc123 --since 30mShows logs from the last day for project 'xyz789'.
Supabase
supabase logs --project-ref xyz789 --since 1dSample Program
This command fetches the last 10 minutes of logs from the Supabase project with ID 'demo123'. It helps you see recent events and errors.
Supabase
supabase logs --project-ref demo123 --since 10mOutputSuccess
Important Notes
You can combine monitoring with alerts to get notified automatically.
Logs can be filtered by severity like INFO, WARN, ERROR to find issues faster.
Supabase also supports real-time monitoring dashboards in its web console.
Summary
Monitoring and logging help you keep your app healthy and fix problems quickly.
Use the supabase logs command with your project ID and time range to see recent events.
Check logs regularly and set alerts for better app reliability.