[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: How to log 'user time' in postgres logs
From:       Adrian Klaver <adrian.klaver () aklaver ! com>
Date:       2019-08-29 22:29:51
Message-ID: 3bdfc324-c1fe-6ac6-1584-0e21ad4891e9 () aklaver ! com
[Download RAW message or body]

On 8/28/19 11:36 AM, francis picabia wrote:
> 

> 
> The other possibility was it just didn't log the slower times, but I 
> have seen larger numbers
> in the 10,000 ms range in the night when some backups and housekeeping 
> happens.
> 
> All   log related settings:
> checkpoint_segments = 12
> logging_collector = on
> log_destination = 'stderr'
> log_directory = 'pg_log'
> log_filename = 'postgresql-%a.log'
> log_truncate_on_rotation = on
> log_rotation_age = 1440
> log_rotation_size = 0
> log_min_messages = info
> log_min_error_statement = debug1
> log_duration = on
> log_line_prefix = '<%t>'

You might also want to log:

log_connections = on

log_disconnections = on

And add to log_line_prefix some mix of:

%u 	User name

%p 	Process ID

%s 	Process start time stamp


> 
> I know it does sound strange, but this is what we battled with for 2.5 
> days until the light
> came on that the vacuum had been set to off on the target system during 
> server migration.
> 
> 



-- 
Adrian Klaver
adrian.klaver@aklaver.com


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic