pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
STDERR not logging after a fix log size
8+ messages / 4 participants
[nested] [flat]

* STDERR not logging after a fix log size
@ 2021-06-18 09:02  still Learner <stilllearner23@gmail.com>
  0 siblings, 3 replies; 8+ messages in thread

From: still Learner @ 2021-06-18 09:02 UTC (permalink / raw)
  To: pgsql-admin

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.

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: STDERR not logging after a fix log size
@ 2021-06-18 10:44  MichaelDBA <MichaelDBA@sqlexec.com>
  parent: still Learner <stilllearner23@gmail.com>
  2 siblings, 0 replies; 8+ messages in thread

From: MichaelDBA @ 2021-06-18 10:44 UTC (permalink / raw)
  To: still Learner <stilllearner23@gmail.com>; +Cc: pgsql-admin

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.
>

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* RE: STDERR not logging after a fix log size
@ 2021-06-18 11:29  Michel SALAIS <msalais@msym.fr>
  parent: still Learner <stilllearner23@gmail.com>
  2 siblings, 1 reply; 8+ messages in thread

From: Michel SALAIS @ 2021-06-18 11:29 UTC (permalink / raw)
  To: 'still Learner' <stilllearner23@gmail.com>; pgsql-admin

Hi,

 

What is the result of the following query?

 

Select name, setting, unit

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: STDERR not logging after a fix log size
@ 2021-06-18 12:18  still Learner <stilllearner23@gmail.com>
  parent: Michel SALAIS <msalais@msym.fr>
  0 siblings, 1 reply; 8+ messages in thread

From: still Learner @ 2021-06-18 12:18 UTC (permalink / raw)
  To: Michel SALAIS <msalais@msym.fr>; +Cc: pgsql-admin

@Michael Vitale, Yes I have done the reload.

@Michel SALAIS, Please find the result of the query.

            name             |               setting               | unit
-----------------------------+-------------------------------------+------
 log_autovacuum_min_duration | 1000                                | ms
 log_checkpoints             | on                                  |
 log_connections             | on                                  |
 log_destination             | stderr                              |
 log_directory               | log                                 |
 log_disconnections          | off                                 |
 log_duration                | off                                 |
 log_error_verbosity         | default                             |
 log_executor_stats          | off                                 |
 log_file_mode               | 0600                                |
 log_filename                | postgresql-%Y-%m-%d_%H%M%S.log      |
 log_hostname                | off                                 |
 log_line_prefix             | %t [%p]: [%h] [%l-1] user=%u,db=%d  |
 log_lock_waits              | on                                  |
 log_min_duration_statement  | 2000                                | ms
 log_min_error_statement     | error                               |
 log_min_messages            | warning                             |
 log_parser_stats            | off                                 |
 log_planner_stats           | off                                 |
 log_replication_commands    | off                                 |
 log_rotation_age            | 1440                                | min
 log_rotation_size           | 716800                              | kB
 log_statement               | none                                |
 log_statement_stats         | off                                 |
 log_temp_files              | -1                                  | kB
 log_timezone                | Asia/Kolkata                        |
 log_truncate_on_rotation    | off                                 |
 logging_collector           | on                                  |
(28 rows)

On Fri, Jun 18, 2021 at 4:59 PM Michel SALAIS <msalais@msym.fr> wrote:

> Hi,
>
>
>
> What is the result of the following query?
>
>
>
> Select name, setting, unit
>
> From pg_settings
>
> Where name like 'log%';
>
>
>
> *Michel SALAIS*
>
> *De :* still Learner <stilllearner23@gmail.com>
> *Envoyé :* vendredi 18 juin 2021 11:03
> *À :* pgsql-admin <pgsql-admin@postgresql.org>
> *Objet :* STDERR not logging after a fix log size
>
>
>
> 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.
>
>
>

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: STDERR not logging after a fix log size
@ 2021-06-18 13:01  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: still Learner <stilllearner23@gmail.com>
  2 siblings, 1 reply; 8+ messages in thread

From: Laurenz Albe @ 2021-06-18 13:01 UTC (permalink / raw)
  To: still Learner <stilllearner23@gmail.com>; pgsql-admin

On Fri, 2021-06-18 at 14:32 +0530, still Learner wrote:
> 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.
>
> -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

That looks just like you want.

The log file never reached the size limit, so it never rotated.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: STDERR not logging after a fix log size
@ 2021-06-18 13:46  still Learner <stilllearner23@gmail.com>
  parent: Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 8+ messages in thread

From: still Learner @ 2021-06-18 13:46 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-admin

On Fri, Jun 18, 2021 at 6:31 PM Laurenz Albe <laurenz.albe@cybertec.at>
wrote:

> On Fri, 2021-06-18 at 14:32 +0530, still Learner wrote:
> > 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.
> >
> > -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
>
> That looks just like you want.
>
> The log file never reached the size limit, so it never rotated.
>
> No, its not. It is from a busy server and generates the log on whole day.
As I said when I set  log_destination to Syslog, I can see the live log.
For stderr its not, even the syntactical errors are also not logged.


> Yours,
> Laurenz Albe
> --
> Cybertec | https://www.cybertec-postgresql.com

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: STDERR not logging after a fix log size
@ 2021-06-19 08:40  still Learner <stilllearner23@gmail.com>
  parent: still Learner <stilllearner23@gmail.com>
  0 siblings, 0 replies; 8+ messages in thread

From: still Learner @ 2021-06-19 08:40 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-admin

Is it a bug or something else, I have applied the latest patch 11.12 and
restarted.

On Fri, Jun 18, 2021 at 7:16 PM still Learner <stilllearner23@gmail.com>
wrote:

>
>
> On Fri, Jun 18, 2021 at 6:31 PM Laurenz Albe <laurenz.albe@cybertec.at>
> wrote:
>
>> On Fri, 2021-06-18 at 14:32 +0530, still Learner wrote:
>> > 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.
>> >
>> > -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
>>
>> That looks just like you want.
>>
>> The log file never reached the size limit, so it never rotated.
>>
>> No, its not. It is from a busy server and generates the log on whole day.
> As I said when I set  log_destination to Syslog, I can see the live log.
> For stderr its not, even the syntactical errors are also not logged.
>
>
>> Yours,
>> Laurenz Albe
>> --
>> Cybertec | https://www.cybertec-postgresql.com
>
>
>

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* RE: STDERR not logging after a fix log size
@ 2021-06-19 20:29  Michel SALAIS <msalais@msym.fr>
  parent: still Learner <stilllearner23@gmail.com>
  0 siblings, 0 replies; 8+ messages in thread

From: Michel SALAIS @ 2021-06-19 20:29 UTC (permalink / raw)
  To: 'still Learner' <stilllearner23@gmail.com>; +Cc: pgsql-admin

Hello,

 

I don’t see a problem in your configuration. But your parameter log_rotation_age (1440 min = 1 day) will lead to a log rotation based on time and it is every day in your case. It will rotate on size only if you have more than 700MB of log per day.

 

Michel SALAIS

 

De : still Learner <stilllearner23@gmail.com> 
Envoyé : vendredi 18 juin 2021 14:19
À : Michel SALAIS <msalais@msym.fr>
Cc : pgsql-admin <pgsql-admin@postgresql.org>
Objet : Re: STDERR not logging after a fix log size

 

@Michael Vitale, Yes I have done the reload.

 

@Michel SALAIS, Please find the result of the query.

 

	

            name             |               setting               | unit 
-----------------------------+-------------------------------------+------
 log_autovacuum_min_duration | 1000                                | ms
 log_checkpoints             | on                                  | 
 log_connections             | on                                  | 
 log_destination             | stderr                              | 
 log_directory               | log                                 | 
 log_disconnections          | off                                 | 
 log_duration                | off                                 | 
 log_error_verbosity         | default                             | 
 log_executor_stats          | off                                 | 
 log_file_mode               | 0600                                | 
 log_filename                | postgresql-%Y-%m-%d_%H%M%S.log      | 
 log_hostname                | off                                 | 
 log_line_prefix             | %t [%p]: [%h] [%l-1] user=%u,db=%d  | 
 log_lock_waits              | on                                  | 
 log_min_duration_statement  | 2000                                | ms
 log_min_error_statement     | error                               | 
 log_min_messages            | warning                             | 
 log_parser_stats            | off                                 | 
 log_planner_stats           | off                                 | 
 log_replication_commands    | off                                 | 
 log_rotation_age            | 1440                                | min
 log_rotation_size           | 716800                              | kB
 log_statement               | none                                | 
 log_statement_stats         | off                                 | 
 log_temp_files              | -1                                  | kB
 log_timezone                | Asia/Kolkata                        | 
 log_truncate_on_rotation    | off                                 | 
 logging_collector           | on                                  | 
(28 rows)

 

On Fri, Jun 18, 2021 at 4:59 PM Michel SALAIS <msalais@msym.fr <mailto:msalais@msym.fr> > wrote:

Hi,

 

What is the result of the following query?

 

Select name, setting, unit

^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2021-06-19 20:29 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-06-18 09:02 STDERR not logging after a fix log size still Learner <stilllearner23@gmail.com>
2021-06-18 10:44 ` MichaelDBA <MichaelDBA@sqlexec.com>
2021-06-18 11:29 ` Michel SALAIS <msalais@msym.fr>
2021-06-18 12:18   ` still Learner <stilllearner23@gmail.com>
2021-06-19 20:29     ` Michel SALAIS <msalais@msym.fr>
2021-06-18 13:01 ` Laurenz Albe <laurenz.albe@cybertec.at>
2021-06-18 13:46   ` still Learner <stilllearner23@gmail.com>
2021-06-19 08:40     ` still Learner <stilllearner23@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox