Thread: Errorlog empty
Hi,
The errorlog is empty. I turned on ‘log_connections’, then logged-on to the instance. But still the errorlog is empty. I would have expected connections would appear at the log.
Any ideas why?
I am new to Postgres, so please excuse my questions.
Maria
> Hi, > The errorlog is empty. I turned on 'log_connections', then logged-on to > the instance. But still the errorlog is empty. I would have expected > connections would appear at the log. > Any ideas why? > I am new to Postgres, so please excuse my questions. > > Maria My configuration: log_destination = 'stderr' logging_collector = on --necesita restart log_min_duration_statement = 0 log_line_prefix = '%t [%p]: [%l-1] [%r]: user=%u ' log_checkpoints = on log_connections = on log_disconnections = on log_lock_waits = on log_temp_files = 0 Saludos, Gilberto Castillo La Habana, Cuba --- This message was processed by Kaspersky Mail Gateway 5.6.28/RELEASE running at host imx3.etecsa.cu Visit our web-site: <http://www.kaspersky.com>, <http://www.viruslist.com>
My configuration:
> Hi,
> The errorlog is empty. I turned on 'log_connections', then logged-on to
> the instance. But still the errorlog is empty. I would have expected
> connections would appear at the log.
> Any ideas why?
> I am new to Postgres, so please excuse my questions.
>
> Maria
log_destination = 'stderr'
logging_collector = on --necesita restart
log_min_duration_statement = 0
log_line_prefix = '%t [%p]: [%l-1] [%r]: user=%u '
log_checkpoints = on
log_connections = on
log_disconnections = on
log_lock_waits = on
log_temp_files = 0
Saludos,
Gilberto Castillo
La Habana, Cuba
---
This message was processed by Kaspersky Mail Gateway 5.6.28/RELEASE running at host imx3.etecsa.cu
Visit our web-site: <http://www.kaspersky.com>, <http://www.viruslist.com>
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
log_checkpoints = on
log_connections = on
log_disconnections = on
log_lock_waits = on
log_temp_files = 0
Ajinkya Bangale
Database Administrator
Office: +919552687400/8400
www.shreeyansh.com
The logging_collector is on, but I don’t know if it was restarted after it was turned on. I did run a ‘pg_ctl reload’, but still it did not log any msgs.
Does it need an actual restart? I cannot simply do that because this is production, has to be scheduled.
Thanks.
Maria
From: Shreeyansh Dba [mailto:shreeyansh2014@gmail.com]
Sent: Thursday, March 12, 2015 1:03 AM
To: gilberto.castillo@etecsa.cu
Cc: Rossi, Maria; Postgres Maillist
Subject: Re: [ADMIN] Errorlog empty
On Thu, Mar 12, 2015 at 3:07 AM, Gilberto Castillo <gilberto.castillo@etecsa.cu> wrote:
> Hi,
> The errorlog is empty. I turned on 'log_connections', then logged-on to
> the instance. But still the errorlog is empty. I would have expected
> connections would appear at the log.
> Any ideas why?
> I am new to Postgres, so please excuse my questions.
>
> MariaMy configuration:
log_destination = 'stderr'
logging_collector = on --necesita restart
log_min_duration_statement = 0
log_line_prefix = '%t [%p]: [%l-1] [%r]: user=%u '
log_checkpoints = on
log_connections = on
log_disconnections = on
log_lock_waits = on
log_temp_files = 0
Saludos,
Gilberto Castillo
La Habana, Cuba
---
This message was processed by Kaspersky Mail Gateway 5.6.28/RELEASE running at host imx3.etecsa.cu
Visit our web-site: <http://www.kaspersky.com>, <http://www.viruslist.com>
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Hi,
In postgresql.conf file you will find some ERROR REPORTING AND LOGGING parameters.
These parameters are responsible for error log generation:
log_destination = 'stderr'
logging_collector = on
log_directory = 'pg_log'
Under When to log:
log_min_error_statement = error
log_min_duration_statement = 0
Under What to log:
log_line_prefix = '%t [%p]: [%l-1] [%r]: user=%u '
log_checkpoints = on
log_connections = on
log_disconnections = on
log_lock_waits = on
log_temp_files = 0
I think changing these parameters will start the error logs in the pg_log folder of your data directory.
Thanks & Regards,
Ajinkya Bangale
Database Administrator
ajinkya.bangale@shreeyansh.com
Office: +919552687400/8400
www.shreeyansh.com
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Rossi, Maria Sent: Thursday, March 12, 2015 11:29 AM To: 'Shreeyansh Dba'; gilberto.castillo@etecsa.cu Cc: Postgres Maillist Subject: Re: [ADMIN] Errorlog empty The logging_collector is on, but I don’t know if it was restarted after it was turned on. I did run a ‘pg_ctl reload’, butstill it did not log any msgs. Does it need an actual restart? I cannot simply do that because this is production, has to be scheduled. Thanks. Maria After ‘pg_ctl reload’ you can check current value of any parameter (including logging_collector) by issuing: Show <parameter_name> i.e.: show logging_collector; Regards, Igor Neyman
It is 'on'. postgres=# show logging_collector; logging_collector ------------------- on (1 row) postgres=# Maria -----Original Message----- From: Igor Neyman [mailto:ineyman@perceptron.com] Sent: Thursday, March 12, 2015 11:52 AM To: Rossi, Maria; 'Shreeyansh Dba'; gilberto.castillo@etecsa.cu Cc: Postgres Maillist Subject: RE: [ADMIN] Errorlog empty From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Rossi, Maria Sent: Thursday, March 12, 2015 11:29 AM To: 'Shreeyansh Dba'; gilberto.castillo@etecsa.cu Cc: Postgres Maillist Subject: Re: [ADMIN] Errorlog empty The logging_collector is on, but I don’t know if it was restarted after it was turned on. I did run a ‘pg_ctl reload’, butstill it did not log any msgs. Does it need an actual restart? I cannot simply do that because this is production, has to be scheduled. Thanks. Maria After ‘pg_ctl reload’ you can check current value of any parameter (including logging_collector) by issuing: Show <parameter_name> i.e.: show logging_collector; Regards, Igor Neyman
> -----Original Message----- > From: Rossi, Maria [mailto:maria.rossi@us.pgds.com] > Sent: Thursday, March 12, 2015 11:55 AM > To: Igor Neyman; 'Shreeyansh Dba'; gilberto.castillo@etecsa.cu > Cc: Postgres Maillist > Subject: RE: [ADMIN] Errorlog empty > > It is 'on'. > > postgres=# show logging_collector; > logging_collector > ------------------- > on > (1 row) > > postgres=# > > > > Maria > > -----Original Message----- > From: Igor Neyman [mailto:ineyman@perceptron.com] > Sent: Thursday, March 12, 2015 11:52 AM > To: Rossi, Maria; 'Shreeyansh Dba'; gilberto.castillo@etecsa.cu > Cc: Postgres Maillist > Subject: RE: [ADMIN] Errorlog empty > > From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin- > owner@postgresql.org] On Behalf Of Rossi, Maria > Sent: Thursday, March 12, 2015 11:29 AM > To: 'Shreeyansh Dba'; gilberto.castillo@etecsa.cu > Cc: Postgres Maillist > Subject: Re: [ADMIN] Errorlog empty > > The logging_collector is on, but I don’t know if it was restarted after it was > turned on. I did run a ‘pg_ctl reload’, but still it did not log any msgs. > Does it need an actual restart? I cannot simply do that because this is > production, has to be scheduled. > > Thanks. > > Maria > > > After ‘pg_ctl reload’ you can check current value of any parameter (including > logging_collector) by issuing: > > Show <parameter_name> > > i.e.: show logging_collector; > > > Regards, > Igor Neyman What about other parameters? Log_destination Log_filename Log_directory Log_connections Log_disconnections Regards, Igor Neyman
Igor, Here's the other 'log' configs: Thanks. postgres=# show log_destination; log_destination ----------------- stderr (1 row) postgres=# show log_filename; log_filename --------------- gp07error.log (1 row) postgres=# show log_directory; log_directory ----------------------------- /dba/pgsql/gp07/pg_errorlog (1 row) postgres=# show log_connections; log_connections ----------------- on (1 row) postgres=# show log_disconnections; log_disconnections -------------------- on (1 row) postgres=# Maria A Rossi Database Administration PGDS (US) email: maria.rossi@us.pgds.com cell phone: 517.256.4392 work phone: 517.367.3099 work phone extension: 23099 -----Original Message----- From: Igor Neyman [mailto:ineyman@perceptron.com] Sent: Thursday, March 12, 2015 12:11 PM To: Rossi, Maria; 'Shreeyansh Dba'; gilberto.castillo@etecsa.cu Cc: Postgres Maillist Subject: RE: [ADMIN] Errorlog empty > -----Original Message----- > From: Rossi, Maria [mailto:maria.rossi@us.pgds.com] > Sent: Thursday, March 12, 2015 11:55 AM > To: Igor Neyman; 'Shreeyansh Dba'; gilberto.castillo@etecsa.cu > Cc: Postgres Maillist > Subject: RE: [ADMIN] Errorlog empty > > It is 'on'. > > postgres=# show logging_collector; > logging_collector > ------------------- > on > (1 row) > > postgres=# > > > > Maria > > -----Original Message----- > From: Igor Neyman [mailto:ineyman@perceptron.com] > Sent: Thursday, March 12, 2015 11:52 AM > To: Rossi, Maria; 'Shreeyansh Dba'; gilberto.castillo@etecsa.cu > Cc: Postgres Maillist > Subject: RE: [ADMIN] Errorlog empty > > From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin- > owner@postgresql.org] On Behalf Of Rossi, Maria > Sent: Thursday, March 12, 2015 11:29 AM > To: 'Shreeyansh Dba'; gilberto.castillo@etecsa.cu > Cc: Postgres Maillist > Subject: Re: [ADMIN] Errorlog empty > > The logging_collector is on, but I don’t know if it was restarted > after it was turned on. I did run a ‘pg_ctl reload’, but still it did not log any msgs. > Does it need an actual restart? I cannot simply do that because this > is production, has to be scheduled. > > Thanks. > > Maria > > > After ‘pg_ctl reload’ you can check current value of any parameter > (including > logging_collector) by issuing: > > Show <parameter_name> > > i.e.: show logging_collector; > > > Regards, > Igor Neyman What about other parameters? Log_destination Log_filename Log_directory Log_connections Log_disconnections Regards, Igor Neyman
> Igor, > > Here's the other 'log' configs: Thanks. > > postgres=# show log_destination; > log_destination > ----------------- > stderr > (1 row) > > postgres=# show log_filename; > log_filename > --------------- > gp07error.log > (1 row) > > postgres=# show log_directory; > log_directory > ----------------------------- > /dba/pgsql/gp07/pg_errorlog > (1 row) Check is exist this directry pg_errorlog and permission Saludos, Gilberto Castillo La Habana, Cuba --- This message was processed by Kaspersky Mail Gateway 5.6.28/RELEASE running at host imx3.etecsa.cu Visit our web-site: <http://www.kaspersky.com>, <http://www.viruslist.com>
On Mar 12, 2015, at 11:12 AM, Rossi, Maria <maria.rossi@us.pgds.com> wrote: > > Igor, > > Here's the other 'log' configs: Thanks. > > postgres=# show log_destination; > log_destination > ----------------- > stderr > (1 row) > > postgres=# show log_filename; > log_filename > --------------- > gp07error.log > (1 row) > > postgres=# show log_directory; > log_directory > ----------------------------- > /dba/pgsql/gp07/pg_errorlog > (1 row) > > postgres=# show log_connections; > log_connections > ----------------- > on > (1 row) > > postgres=# show log_disconnections; > log_disconnections > -------------------- > on > (1 row) > What about logging_collector? If that's not set, I think your log filename will be ignored and messages will go to stderr.See: <http://www.postgresql.org/docs/9.4/static/runtime-config-logging.html> -- Scott Ribe scott_ribe@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice
What about logging_collector? If that's not set, I think your log filename will be ignored and messages will go to stderr. See: <http://www.postgresql.org/docs/9.4/static/runtime-config-logging.html>On Mar 12, 2015, at 11:12 AM, Rossi, Maria <maria.rossi@us.pgds.com> wrote:
>
> Igor,
>
> Here's the other 'log' configs: Thanks.
>
> postgres=# show log_destination;
> log_destination
> -----------------
> stderr
> (1 row)
>
> postgres=# show log_filename;
> log_filename
> ---------------
> gp07error.log
> (1 row)
>
> postgres=# show log_directory;
> log_directory
> -----------------------------
> /dba/pgsql/gp07/pg_errorlog
> (1 row)
>
> postgres=# show log_connections;
> log_connections
> -----------------
> on
> (1 row)
>
> postgres=# show log_disconnections;
> log_disconnections
> --------------------
> on
> (1 row)
>
--
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Ajinkya Bangale
Database Administrator
Ph: +91-9552688400 / 7400
Email ID: ajinkya.bangale@shreeyansh.com
www.shreeyansh.com
Shreeyansh, Scott,
Thanks for responding. Here’s the value of a couple log parms
gp07> psql -d postgres -c"show log_file_mode"
log_file_mode
---------------
0600
(1 row)
gp07> psql -d postgres -c"show log_filename"
log_filename
---------------
gp07error.log
(1 row)
gp07> psql -d postgres -c"show logging_collector"
logging_collector
-------------------
on
(1 row)
Also, we have a monitor that checks the errorlog. This monitor appends the current log to an archive file (example, errorlog.201503), then touch a new ‘error.log’. After the touch, the new errorlog is not written to anymore, until postgres is bounced. I should also note that new error.log is owned by the monitor ID:
-rw-rw-r-- 1 psgdba dbagroup 298 Mar 13 05:43 gl07error.log
dbagroup members are: psgdba and instance-owner.
Thanks.
Maria A Rossi
Database Administration
PGDS (US)
email: maria.rossi@us.pgds.com
cell phone: 517.256.4392
work phone: 517.367.3099
work phone extension: 23099
From: Shreeyansh Dba [mailto:shreeyansh2014@gmail.com]
Sent: Friday, March 13, 2015 1:14 AM
To: Scott Ribe
Cc: Rossi, Maria; Postgres Maillist
Subject: Re: [ADMIN] Errorlog empty
On Thu, Mar 12, 2015 at 11:09 PM, Scott Ribe <scott_ribe@elevated-dev.com> wrote:
On Mar 12, 2015, at 11:12 AM, Rossi, Maria <maria.rossi@us.pgds.com> wrote:
>
> Igor,
>
> Here's the other 'log' configs: Thanks.
>
> postgres=# show log_destination;
> log_destination
> -----------------
> stderr
> (1 row)
>
> postgres=# show log_filename;
> log_filename
> ---------------
> gp07error.log
> (1 row)
>
> postgres=# show log_directory;
> log_directory
> -----------------------------
> /dba/pgsql/gp07/pg_errorlog
> (1 row)
>
> postgres=# show log_connections;
> log_connections
> -----------------
> on
> (1 row)
>
> postgres=# show log_disconnections;
> log_disconnections
> --------------------
> on
> (1 row)
>What about logging_collector? If that's not set, I think your log filename will be ignored and messages will go to stderr. See: <http://www.postgresql.org/docs/9.4/static/runtime-config-logging.html>
--
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Hi,
Reload is fine no need to restart.
you can check whether parameters are configured using
SHOW <parameter-name>;
May be there some permission issue to the log_destination folder.So once check the permissions and
Try
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
log_file_mode = 0600
And let me know the output.
--
Thanks & Regards
Ajinkya Bangale
Database Administrator
Ph: +91-9552688400 / 7400
Email ID: ajinkya.bangale@shreeyansh.com
www.shreeyansh.com
Also, we have a monitor that checks the errorlog. This monitor appends the current log to an archive file (example, errorlog.201503), then touch a new ‘error.log’. After the touch, the new errorlog is not written to anymore, until postgres is bounced. I should also note that new error.log is owned by the monitor ID:
Analista de Banco de Dados
Dextra Sistemas - MPS.Br nível F!
www.dextra.com.br/postgres
Matheus,
Thanks for the response. I disabled the errorlog monitor and after the postgres was bounced, errorlog is growing again!! I will revise the monitor script to run the pg_rotate_logfile function.
BTW, I did not purposely hid that piece of information. I just found out about it as I dug more into the problem.
Thanks.
Maria A Rossi
Database Administration
PGDS (US)
email: maria.rossi@us.pgds.com
cell phone: 517.256.4392
work phone: 517.367.3099
work phone extension: 23099
From: Matheus de Oliveira [mailto:matioli.matheus@gmail.com]
Sent: Friday, March 13, 2015 7:55 AM
To: Rossi, Maria
Cc: Shreeyansh Dba; Scott Ribe; Postgres Maillist
Subject: Re: [ADMIN] Errorlog empty
On Fri, Mar 13, 2015 at 7:02 AM, Rossi, Maria <maria.rossi@us.pgds.com> wrote:
Also, we have a monitor that checks the errorlog. This monitor appends the current log to an archive file (example, errorlog.201503), then touch a new ‘error.log’. After the touch, the new errorlog is not written to anymore, until postgres is bounced. I should also note that new error.log is owned by the monitor ID:
That is a very important bit of information that you seem to have hidden from the list since the beginning. If an external process is moving the file that PostgreSQL is currently writting to, then it must somehow make the PostgreSQL's logger process aware of that. To do that you can call pg_rotate_logfile function:
$ psql -c "SELECT pg_rotate_logfile()"
Although if you remove the file before calling it, you can lose some information in between, so I recommend using a log_filename that has date/time information (like the default one), so you can call pg_rotate_logfile, wait for PostgreSQL to create a new one, then you are safe to move the old ones to whatever location you want.
Regards,
--
Matheus de Oliveira
Analista de Banco de Dados
Dextra Sistemas - MPS.Br nível F!
www.dextra.com.br/postgres
Thanks for the response. I disabled the errorlog monitor and after the postgres was bounced, errorlog is growing again!! I will revise the monitor script to run the pg_rotate_logfile function.
BTW, I did not purposely hid that piece of information. I just found out about it as I dug more into the problem.
Analista de Banco de Dados
Dextra Sistemas - MPS.Br nível F!
www.dextra.com.br/postgres