Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tcle0-002VsP-DS for pgsql-general@arkaria.postgresql.org; Tue, 28 Jan 2025 13:28:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tcldz-0016lT-3D for pgsql-general@arkaria.postgresql.org; Tue, 28 Jan 2025 13:28:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tcldy-0016j1-Mq for pgsql-general@lists.postgresql.org; Tue, 28 Jan 2025 13:28:42 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tcldv-001xqB-2I for pgsql-general@postgresql.org; Tue, 28 Jan 2025 13:28:42 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-436202dd730so39527405e9.2 for ; Tue, 28 Jan 2025 05:28:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1738070919; x=1738675719; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=O50GRH7h/avIkA4y5aNbo8wq0jtmDyWnn0gfe6OIhg4=; b=LcKmT/lcsOBdF+/sWzxgHHYd7BZmF2OC36byhRE+xZwQp+eEVGtL3iI5yX+3CyIW1g TbcvKBXWt4u5ZKY2+ETZo4SVbRfnjBbUk/0LXirSLXTf0opEXQ+QuUUSl/265SPJiWQ9 TeAwXiEkwdqhyAuc6L01v443Ufl01dwD9eei/vPUntMD3nNPTUfYAU75gbM0uX6J192I l/BT00g42Nuy9mpDvjKnqYq0+xaqt5gTvLmsfzTCeszvStxK2eG67KrMhUVQwxh4iH+L jxwbHiHeRdkw91C03A8fCGsY25xMRsdgYikYOID9QlVIk4P3aAQo9qkVRK5m142T5B54 Jmrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738070919; x=1738675719; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=O50GRH7h/avIkA4y5aNbo8wq0jtmDyWnn0gfe6OIhg4=; b=DVp6UdE7h3H0zeqbzqaQTjxlnzU8a5ybnRH5Ow/r8+5ITvCaT0+goK0+bnxohF1mFT OWC5ybT9HTlC/mx/VfKrFXI5qVifgIec7JWtMEn1mssDytD7fAjgjDcf1TqVyG5crr1C D7vHdBx/knSyK9JS4t9RkIbTDG1h/XSV0PxuIpbvdsz3PiX/44r07xQ8+H6cGwgSzG/I Qndw39fGAVKdk68SCfuGdqmCzKkBdQivpy0Sk+2zSmOKc318xjChMmkCsNXrFCdFClo4 ZkynAjur1OWdths7npfxu59v/0+0J5gYfCG7zOD1kznMs/2G8EuhbWtBEdELSTTcOwTZ bwtQ== X-Forwarded-Encrypted: i=1; AJvYcCUxFTUcwrnXiS7GHJbgG9A4HlHjNh2XLHsHx85WgZ4CIohYjsmVHO6mBC+sOElqtllddpphDSF80YLKZXai@postgresql.org X-Gm-Message-State: AOJu0Yy2dhHqrD2hGzZp6/i8VqjzHLf/o+NMEVrUvE/0IwIbxzoO+9CZ xHaPZc/YiVfTx//FXCJE7QHEGVXW1JBfQHH4FwfJK/wXr3jiiJFQpjN1VtDBYmuuAVBFJ/SL+Zx u X-Gm-Gg: ASbGnct10a6FFaLSeWSJ/9oDWd/Sk7+gudHVXjb/AvVrer0Onje9h624PW+HLXKMARC 1J1/b7R5DgplE6MEiT3UWhldpG6EY/wGWSarG9oOuHVInQzJCZo/VilH3q4zJfn11e2RD1eh6Rf BDaUqikMiM7yez/WEl0K+ZDm0CuBgITVGQrefGKCYHLrORlI1VEwkftH5td8SC2wc5xyA//+O22 DTug2H7CM4WWwpy80+dE/LMoDU7ca/AFo8LfodGEIZkZWkiAK/CHr9SXgbf7r5kEhy8vKRJYlPN SS3hvjJQ/Jz6bAezxWalUru2Dd1qJjttN7m+h+I8+BdCXw== X-Google-Smtp-Source: AGHT+IGhwqZfIpxh3tcYlN3nIcnz+/gdglL+vYaykJg2Z9RHTpkuIlbTUeFlLS2afl1pb0SJqUdmXg== X-Received: by 2002:a05:600c:1f86:b0:436:aaf:7eb9 with SMTP id 5b1f17b1804b1-43891439d5fmr360673395e9.20.1738070918515; Tue, 28 Jan 2025 05:28:38 -0800 (PST) Received: from localhost.localdomain ([2001:871:5e:b8bb:3ffe:1464:4ef8:4b1a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd4fa46esm170957085e9.1.2025.01.28.05.28.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jan 2025 05:28:38 -0800 (PST) Message-ID: Subject: Re: Log retention query From: Laurenz Albe To: Paul Brindusa , pgsql-general Date: Tue, 28 Jan 2025 14:28:36 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.3 (3.54.3-1.fc41) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2025-01-28 at 09:57 +0000, Paul Brindusa wrote: > Good morning everyone, >=20 > Before I get on with today's problem, I would like to say how much I appr= eciate this community and everything that you do for end users. >=20 > In today's problem I would like to understand if the following lines in o= ur config handle the log rotation for our clusters? >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 log_checkpoints: on > =C2=A0 =C2=A0 =C2=A0 =C2=A0 logging_collector: on > =C2=A0 =C2=A0 =C2=A0 =C2=A0 log_truncate_on_rotation: on > =C2=A0 =C2=A0 =C2=A0 =C2=A0 log_rotation_age: 1d > =C2=A0 =C2=A0 =C2=A0 =C2=A0 log_rotation_size: 1GB > =C2=A0 =C2=A0 =C2=A0 =C2=A0 log_error_verbosity: verbose >=20 > I have been deleting the logs manually for the last month, since I am con= fused how the log collector rotates them.=C2=A0 >=20 > Am looking to delete logs older than 180 days. What are we doing=C2=A0wro= ng in the config? It all depends on how you configured "log_filename". If the setting is "postgresql-%a.log" or "postgresql-%d.log", PostgreSQL will recycle the old log files once a week or once a month. If the setting is the default "postgresql-%Y-%m-%d_%H%M%S.log", the same log file name will never be reused, and there will be no log rotation. PostgreSQL doesn't actively delete old log files. Yours, Laurenz Albe