Better Stack Supabase logging

Collect logs from your Supabase projects by configuring a custom log drain endpoint.

Log drains are not available on the Supabase Free plan.

1. Create a new source

Create a new HTTP source in Better Stack.

Copy the Ingesting host and Source token from the source details. You will need these in the next step.

2. Configure log drain in Supabase

In your Supabase project dashboard, go to Project Settings β†’ Log drains, and create a new Custom endpoint.

Custom endpoint log drain

Set the Endpoint URL to:

Endpoint URL for your destination
https://$INGESTING_HOST?source_token=$SOURCE_TOKEN


After you click Save destination, you should see your Supabase logs in Better Stack β†’ Live tail.

3. Enhance log display and data

To make the integration even better, you can apply some optional configurations in Better Stack:

Rename the timestamp field

Supabase logs includes a timestamp field. To align this with Better Stack's standard dt field, you can use a VRL transformation.

Go to Sources β†’ Supabase source β†’ Configure β†’ Transformations tab, and add the following VRL:

VRL transformation to rename the timestamp field
.dt = del(.timestamp)

Customize the Live tail message format

To see the most relevant information from your Supabase logs directly in the Live tail, you can customize the default message format.

Go to Sources β†’ Supabase source β†’ Configure β†’ Advanced settings tab, and set the Live tail message format to:

Live tail message format
{metadata.host as host} {metadata.level as level} {event_message::text}

This will display the host, log level, and the main message content prominently in your Live tail.

Need help?

Please let us know at hello@betterstack.com.
We're happy to help! πŸ™