Hi everyone, I’m looking to set up log rotation fo...
# ask-community
s
Hi everyone, I’m looking to set up log rotation for a Prefect database that is running inside PostgreSQL. Could anyone provide guidance on the following: 1. How can I set up log rotation for a PostgreSQL database used by Prefect? Are there specific configurations or tools recommended for this task? 2. Which tables in the Prefect database are involved with logging and should be considered for log rotation? Are there tables that I should avoid touching or that don’t require log rotation? Any advice or best practices would be greatly appreciated! Thanks in advance!
n
hi @siddhant - here's a docker compose example https://github.com/PrefectHQ/prefect-background-task-examples/blob/main/chaos-duck/docker-compose.yaml#L2-L27 but essentially after you start postgres, you just have to set
PREFECT_API_DATABASE_CONNECTION_URL
accordingly in your active profile with
prefect config set PREFECT_API_DATABASE_CONNECTION_URL=...
or setting that env var
export PREFECT_API_DATABASE_CONNECTION_URL=...
s
i am using postgres in kubernetes cluster and so what could be the solution for this in kubernetes can you guide me more specificly @Nate
i would use the helm charts if you're using kubernetes with an open-source server
there are guides linked in the readme
feel free to ask here if the guides are insufficient in some way
s
@Nate my question is i am having issue in log rotation of prefect database which is on postgres so how can i apply log rotation and on which table i can apply log rotation can you give me a proper explanation ? please