supabase tail command for logs
Feature request
Is your feature request related to a problem? Please describe.
I should be able to tail my Supabase logs from the Supabase CLI.
Logs should include Kong, Postgres, Storage, Functions, Webhooks and logs re any emails sent.
Describe the solution you'd like
supabase tail should stream my logs to my console. Maybe provide an option to limit which kinds of logs e.g. supabase tail -postgres
Logs could be delivered via a websocket connection between the CLI and my Supabase instance.
supabase tail should work with self-hosted and hosted supabase instances.
Describe alternatives you've considered
None really, this is essentially feature parity for other CLI dev tools.
Additional context
How do you even view db logs?
Hi @plmwd , the local postgres logs are stored inside the postgres container, timestamped by the hour.
$ docker exec -it supabase_db_supabase-dev ls -la /var/log/postgresql
total 228
drwxrwxr-t 1 root postgres 4096 Sep 2 05:54 .
drwxr-xr-x 1 root root 4096 Jan 27 2022 ..
-rw-r----- 1 postgres postgres 216553 Sep 2 05:55 server_0500_UTC.csv
-rw-r----- 1 postgres postgres 406 Sep 2 05:54 server_0500_UTC.log
We are actively looking into exposing logs explorer in local studio so that it's as easier view and filter Postgres logs. For other services like Kong, the currently supported way is to tail via docker logs.
docker logs -f supabase_kong_supabase-dev
Any updates on this?
Hi @plmwd , the local postgres logs are stored inside the postgres container, timestamped by the hour.
$ docker exec -it supabase_db_supabase-dev ls -la /var/log/postgresql total 228 drwxrwxr-t 1 root postgres 4096 Sep 2 05:54 . drwxr-xr-x 1 root root 4096 Jan 27 2022 .. -rw-r----- 1 postgres postgres 216553 Sep 2 05:55 server_0500_UTC.csv -rw-r----- 1 postgres postgres 406 Sep 2 05:54 server_0500_UTC.logWe are actively looking into exposing logs explorer in local studio so that it's as easier view and filter Postgres logs. For other services like Kong, the currently supported way is to tail via docker logs.
docker logs -f supabase_kong_supabase-dev
@sweatybridge are you guys still looking at exposing the local logs in the studio?
Hi @user72356, yes we have just released supabase/logflare docker image. We will be testing integration on self-hosted and CLI in the next few weeks.
It seems that the pgsql logs have been disabled. Those are not generated anymore :(
Hi @user72356, yes we have just released supabase/logflare docker image. We will be testing integration on self-hosted and CLI in the next few weeks.
How is this coming along? I saw some docs stating I have to have a Google Cloud account just to see the local logs? Did I understand that correctly?
I saw some docs stating I have to have a Google Cloud account just to see the local logs? Did I understand that correctly?
Yes, at its current stage logflare does require a GCP account which is rather counter intuitive for local development.
That said, the logflare team is working on supporting postgres as the storage backend. But it's gonna take some time because we have to rework the BigQuery queries as well. You can follow the logflare repo for more status updates.
Just re-enabling the pgsql logs in the docker container would make our lives much easier. Is it a problem to do so while waiting for better options with logflare?
It seems that the pgsql logs have been disabled. Those are not generated anymore :(
We have changed the postgres logs settings back to stdout so you should be able to get the local postgres logs by docker logs command:
docker logs -f supabase_db_<project>
If you have a long running local development setup and the logs become too much for docker to handle, you can enable logflare to store the logs on BigQuery.