Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1luBz6-0001lk-Ua for pgsql-admin@arkaria.postgresql.org; Fri, 18 Jun 2021 10:44:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1luBz5-0005ye-IM for pgsql-admin@arkaria.postgresql.org; Fri, 18 Jun 2021 10:44:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1luBz5-0005yW-5J for pgsql-admin@lists.postgresql.org; Fri, 18 Jun 2021 10:44:23 +0000 Received: from mout.perfora.net ([74.208.4.194]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1luBz2-0004qD-10 for pgsql-admin@postgresql.org; Fri, 18 Jun 2021 10:44:22 +0000 Received: from [192.168.1.165] ([98.169.214.254]) by mrelay.perfora.net (mreueus004 [74.208.5.2]) with ESMTPSA (Nemesis) id 1MqaIG-1lYHRZ1lOi-00mYKH; Fri, 18 Jun 2021 12:44:17 +0200 Subject: Re: STDERR not logging after a fix log size To: still Learner Cc: pgsql-admin References: From: MichaelDBA Message-ID: <9f6ccc33-05a6-1f26-9d50-5d5b1d06a025@sqlexec.com> Date: Fri, 18 Jun 2021 06:44:15 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 PostboxApp/7.0.48 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------5C7B27ADA93C4C3CAFCE5A6D" Content-Language: en-US X-Provags-ID: V03:K1:1ApWjB08YJRWmW4eTfjefeSpwQS9uDegb8ui83uwosX65MOUtoV J32owFiLp4r6RMFOL0XLL6osf1JBsNgI+six+z9+gVIsxHrxrrnB9TBPOktLHW9md2B+4OS uhpLd/dzK2MsYJ+ctyTyvn5SpavFuWYyddj3+31JG1acbGPJ6OLmq41sFA7UKqFet43Mpgb VHs17AJdXpIFYRfs+d5mQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:jChqq8w0hgE=:wTqsczcb6Ec7GWvE/w9UQJ veE+tlnHINetgO05p4x2208EeSuH30xUVnXPWNFPnyl7bETQpCJYJMaE7IGjOoCdRGN4IDKJp iyyMN/pIO7hH520fjSstzjbtu8zCVlA4JUUFy2JTSyKuqWDQF/hJ+puwqKEC6xlAmonNPE1qb ITC/LafwoVJMdMtqrgcz2uBeYbkLXOpvYpHX/KlWKddMhJA7Atq5u8kJ4cYcHnA+86noWm9hQ zvE5nb5nEHT/6cuLKK4SCrbOEydraSGEUbi6w+0u7iJxa4jCb4+w60yCwJCCbXepNqdPPKj65 OL0O/7ac6Jwj4plNK5eTtDD8MNeH0x0BYP1lKg7XrpDG7muPcPNBU2p2LojJXDfUIWnlWB+lj s9sgrUjnRnZQNL4E4azRPKG0oj9pvIPt8xQeEpb27Avi4jnF8rpUQCT2fZ61pLc0gW1wCcm0c Q3gZxvl2o0Ax8zIQZWpMxV6bg8isVKwjRfWTA+d7FIewZdiP6A1SOTAaQ501ZnlFjtwX+LxaQ oPVXpfGm4hn4fVZF12xPJY= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------5C7B27ADA93C4C3CAFCE5A6D Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit You probaby did this, but just to make sure, did you reload the cluster to effect the changes? Regards, Michael Vitale still Learner wrote on 6/18/2021 5:02 AM: > Hi There, > > A few days back (on 9th June) I have changed my log_rotation_size  to > 30 MB and on the same day again reset to 500 MB. for few days it went > well, from 15th June itself generating only 30MB files. Now I have > reset to 700 MB and reloaded, still am getting the same size of log > and the log file is also not rotating. > > I have tried changing the log_destination to Syslog which is logging > in /var/log/messages however stderr not logging in to the log folder. > > FYI ... please check below file stats and the log parameters. > > postgres=# select version(); >                                    version > ----------------------------------------------------------------------------- >  PostgreSQL 11.9 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 5.5.0, > 64-bit > (1 row) > > ps -ef|grep logger > postgres  16765  16763  0 May15 ?        00:13:33 postgres: logger > > *-rw------- 1 postgres postgres  32885638 Jun  9 07:04 > postgresql-2021-06-09_000000.log* > *-rw------- 1 postgres postgres  10765412 Jun  9 23:59 > postgresql-2021-06-09_214301.log > -rw------- 1 postgres postgres 114219472 Jun 11 00:00 > postgresql-2021-06-10_000000.log > *-rw------- 1 postgres postgres 106193384 Jun 11 23:59 > postgresql-2021-06-11_000000.log > -rw------- 1 postgres postgres 103008728 Jun 12 23:59 > postgresql-2021-06-12_000000.log > -rw------- 1 postgres postgres 104213596 Jun 14 00:00 > postgresql-2021-06-13_000000.log > -rw------- 1 postgres postgres 109578809 Jun 14 23:59 > postgresql-2021-06-14_000000.log > *-rw------- 1 postgres postgres  30847172 Jun 15 08:02 > postgresql-2021-06-15_000000.log > *-rw------- 1 postgres postgres  32452541 Jun 16 06:22 > postgresql-2021-06-16_000000.log > -rw------- 1 postgres postgres  31439856 Jun 17 06:20 > postgresql-2021-06-17_000000.log > -rw------- 1 postgres postgres  30859375 Jun 18 06:23 > postgresql-2021-06-18_000000.log > > >  log_autovacuum_min_duration    1s > >  log_destination                stderr > >  log_directory        log >  log_error_verbosity            default > >  log_file_mode        0600 > >  log_filename postgresql-%Y-%m-%d_%H%M%S.log >  log_line_prefix    %t [%p]: [%h] [%l-1] user=%u,db=%d >  log_min_duration_statement     2s >  log_min_messages               warning >  log_rotation_age         1d > >  log_rotation_size              700MB > >  log_truncate_on_rotation      off >  logging_collector             on > > Please assist me if I had missed any. > --------------5C7B27ADA93C4C3CAFCE5A6D Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit You probaby did this, but just to make sure, did you reload the cluster to effect the changes?

Regards,
Michael Vitale

still Learner wrote on 6/18/2021 5:02 AM:
Hi There,

A few days back (on 9th June) I have changed my log_rotation_size  to 30 MB and on the same day again reset to 500 MB. for few days it went well, from 15th June itself generating only 30MB files. Now I have reset to 700 MB and reloaded, still am getting the same size of log and the log file is also not rotating.

I have tried changing the log_destination to Syslog which is logging in /var/log/messages however stderr not logging in to the log folder.

FYI ... please check below file stats and the log parameters.

postgres=# select version();
                                   version                                  
-----------------------------------------------------------------------------
 PostgreSQL 11.9 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 5.5.0, 64-bit
(1 row)

ps -ef|grep logger
postgres  16765  16763  0 May15 ?        00:13:33 postgres: logger
 
-rw------- 1 postgres postgres  32885638 Jun  9 07:04 postgresql-2021-06-09_000000.log
-rw------- 1 postgres postgres  10765412 Jun  9 23:59 postgresql-2021-06-09_214301.log
-rw------- 1 postgres postgres 114219472 Jun 11 00:00 postgresql-2021-06-10_000000.log
-rw------- 1 postgres postgres 106193384 Jun 11 23:59 postgresql-2021-06-11_000000.log
-rw------- 1 postgres postgres 103008728 Jun 12 23:59 postgresql-2021-06-12_000000.log
-rw------- 1 postgres postgres 104213596 Jun 14 00:00 postgresql-2021-06-13_000000.log
-rw------- 1 postgres postgres 109578809 Jun 14 23:59 postgresql-2021-06-14_000000.log
-rw------- 1 postgres postgres  30847172 Jun 15 08:02 postgresql-2021-06-15_000000.log
-rw------- 1 postgres postgres  32452541 Jun 16 06:22 postgresql-2021-06-16_000000.log
-rw------- 1 postgres postgres  31439856 Jun 17 06:20 postgresql-2021-06-17_000000.log
-rw------- 1 postgres postgres  30859375 Jun 18 06:23 postgresql-2021-06-18_000000.log


 log_autovacuum_min_duration    1s
 
 log_destination                stderr                                                                                                  

 log_directory        log                                                                                                                                                              
 log_error_verbosity            default                                                                                                
                               
 log_file_mode        0600                                                                                                    
                               
 log_filename                   postgresql-%Y-%m-%d_%H%M%S.log                                                                                   
 log_line_prefix                %t [%p]: [%h] [%l-1] user=%u,db=%d                                                                                     
 log_min_duration_statement     2s                                                                                                                               
 log_min_messages               warning                                                                                                
 log_rotation_age               1d                                                                                                      
                               
 log_rotation_size              700MB                                                                                                  
                               
 log_truncate_on_rotation      off     
                                                                                                     
 logging_collector             on   

Please assist me if I had missed any.


--------------5C7B27ADA93C4C3CAFCE5A6D--