Обсуждение: main.log file not being updated

Поиск
Список
Период
Сортировка

main.log file not being updated

От
Anson Abraham
Дата:
my postgresql-9.0-main.log log file is 0 bytes.  Postgres user has perms to write to it.  And and postgresql.conf file shows to log, but it's not.  Not sure why.

I have the defaults set in except for these changes:

log_connections = on
log_disconnections = on
log_duration = off

log_line_prefix = '%t %p %h %d ' 
log_lock_waits = on 
log_statement = 'none'

any ideas?  I used to write log entries, but now, not so much.

Thanks.

Re: main.log file not being updated

От
Adrian Klaver
Дата:
On 01/24/2013 09:29 AM, Anson Abraham wrote:
> my postgresql-9.0-main.log log file is 0 bytes.  Postgres user has perms
> to write to it.  And and postgresql.conf file shows to log, but it's
> not.  Not sure why.
>
> I have the defaults set in except for these changes:
>
> log_connections = on
> log_disconnections = on
> log_duration = off
>
> log_line_prefix = '%t %p %h %d '
> log_lock_waits = on
> log_statement = 'none'
>
> any ideas?  I used to write log entries, but now, not so much.

What do the following show?:

log_destination =
logging_collector

Have you restarted the server since making the changes?

How was Postgres installed and what platform/distrubution?
How is Postgres started?

>
> Thanks.


--
Adrian Klaver
adrian.klaver@gmail.com


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: main.log file not being updated

От
Anson Abraham
Дата:
#log_destination = 'stderr'
#logging_collector = off 

It was when it was restarted that this didn't start logging.  To restart is an option, but one I'd like to avoid.

It's 9.0 on debian squeeze.  
init.d/postgres start

It was writing before.  Just stopped after the last restart or rather reload of the config file.  Also when I did an LSOF of the file, nothing was locking it ... ie usually postgres would be the one, but not in this case.


On Thu, Jan 24, 2013 at 12:39 PM, Adrian Klaver <adrian.klaver@gmail.com> wrote:
On 01/24/2013 09:29 AM, Anson Abraham wrote:
my postgresql-9.0-main.log log file is 0 bytes.  Postgres user has perms
to write to it.  And and postgresql.conf file shows to log, but it's
not.  Not sure why.

I have the defaults set in except for these changes:

log_connections = on
log_disconnections = on
log_duration = off

log_line_prefix = '%t %p %h %d '
log_lock_waits = on
log_statement = 'none'

any ideas?  I used to write log entries, but now, not so much.

What do the following show?:

log_destination =
logging_collector

Have you restarted the server since making the changes?

How was Postgres installed and what platform/distrubution?
How is Postgres started?


Thanks.


--
Adrian Klaver
adrian.klaver@gmail.com

Re: main.log file not being updated

От
Adrian Klaver
Дата:
On 01/24/2013 10:36 AM, Anson Abraham wrote:
> #log_destination = 'stderr'
> #logging_collector = off
>
> It was when it was restarted that this didn't start logging.  To restart
> is an option, but one I'd like to avoid.
>
> It's 9.0 on debian squeeze.
> init.d/postgres start
>
> It was writing before.  Just stopped after the last restart or rather
> reload of the config file.  Also when I did an LSOF of the file, nothing
> was locking it ... ie usually postgres would be the one, but not in this
> case.

http://www.postgresql.org/docs/9.0/interactive/runtime-config-logging.html

logging_collector (boolean)
This parameter captures plain and CSV-format log messages sent to stderr
and redirects them into log files. This approach is often more useful
than logging to syslog, since some types of messages might not appear in
syslog output (a common example is dynamic-linker failure messages).
This parameter can only be set at server start.


Would seem something changed the config file to turn off the collector.
You will need to set on and restart.


--
Adrian Klaver
adrian.klaver@gmail.com


Re: main.log file not being updated

От
Adrian Klaver
Дата:
On 01/24/2013 12:44 PM, Anson Abraham wrote:
> i've always had logging_collector off.  it would still log query /
> transactions that failed to the "syslog"
> (var/log/postgres/postgres-9.0-main.log).
> the only thing I've changed was turning log_duration back to off.  But
> I've gone back and forth with what, and doing a postgres reload.
>

CCing list.

Then shouldn't

log_destination = 'stderr'

be

log_destination = 'syslog'

You may also want to check that the syslog configuration has not changed
and it is actually configured to catch the Postgres output.

Would not hurt to check the init.d script to see if it is overriding the
logging settings.


Adrian Klaver
adrian.klaver@gmail.com


Re: main.log file not being updated

От
Adrian Klaver
Дата:
On 01/24/2013 01:38 PM, Anson Abraham wrote:
> I though to do that w/ log_destination, but i left everything pretty
> much default except those params I mentioned earlier.
>
> Interestingly i have another DB server (same ver, etc...) w/ exact same
> config params w/ postgres and sys log config and that is writing to the
> "system postgres log".
>
>
> it's a head scratcher for me.
>

Well something is not the same. Did you check the start up script and
the syslog configuration?


--
Adrian Klaver
adrian.klaver@gmail.com


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: main.log file not being updated

От
Anson Abraham
Дата:
I though to do that w/ log_destination, but i left everything pretty much default except those params I mentioned earlier.

Interestingly i have another DB server (same ver, etc...) w/ exact same config params w/ postgres and sys log config and that is writing to the "system postgres log".


it's a head scratcher for me.

On Thu, Jan 24, 2013 at 4:08 PM, Adrian Klaver <adrian.klaver@gmail.com> wrote:
On 01/24/2013 12:44 PM, Anson Abraham wrote:
i've always had logging_collector off.  it would still log query /
transactions that failed to the "syslog"
(var/log/postgres/postgres-9.0-main.log).
the only thing I've changed was turning log_duration back to off.  But
I've gone back and forth with what, and doing a postgres reload.


CCing list.

Then shouldn't

log_destination = 'stderr'

be

log_destination = 'syslog'

You may also want to check that the syslog configuration has not changed and it is actually configured to catch the Postgres output.

Would not hurt to check the init.d script to see if it is overriding the logging settings.


Adrian Klaver
adrian.klaver@gmail.com

Re: main.log file not being updated

От
Adrian Klaver
Дата:
On 01/25/2013 09:00 AM, Anson Abraham wrote:
> identical.
>

This is on Debian correct?
Are you using the Debian pg_cluster system?
In particular are using pg_ctlcluster to start the server?

 From what I remember of pg cluster is that the init.d script is called
by pg_ctlcluster and the pg_ctcluster code takes care of setting up the
logging to the appropriate log in /var/log/postgres. If you call the
init script directly it just follows  whatever are the settings in
postgresql.conf, which in your case would not actually log anything.


Another possibility.
Are you sure you are looking at the correct log?
One of the features of pg cluster is that there can be multiple versions
of Postgres and multiple db clusters in a version. Again if I remember
correctly main is the default cluster for a version.

Is it possible there is another cluster running PG 9.0?


--
Adrian Klaver
adrian.klaver@gmail.com


Re: main.log file not being updated

От
Adrian Klaver
Дата:
On 01/24/2013 09:29 AM, Anson Abraham wrote:
> my postgresql-9.0-main.log log file is 0 bytes.  Postgres user has perms
> to write to it.  And and postgresql.conf file shows to log, but it's
> not.  Not sure why.
>
> I have the defaults set in except for these changes:
>
> log_connections = on
> log_disconnections = on
> log_duration = off
>
> log_line_prefix = '%t %p %h %d '
> log_lock_waits = on
> log_statement = 'none'
>
> any ideas?  I used to write log entries, but now, not so much.

What do the following show?:

log_destination =
logging_collector

Have you restarted the server since making the changes?

How was Postgres installed and what platform/distrubution?
How is Postgres started?

>
> Thanks.


--
Adrian Klaver
adrian.klaver@gmail.com


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: main.log file not being updated

От
Adrian Klaver
Дата:
On 01/24/2013 01:38 PM, Anson Abraham wrote:
> I though to do that w/ log_destination, but i left everything pretty
> much default except those params I mentioned earlier.
>
> Interestingly i have another DB server (same ver, etc...) w/ exact same
> config params w/ postgres and sys log config and that is writing to the
> "system postgres log".
>
>
> it's a head scratcher for me.
>

Well something is not the same. Did you check the start up script and
the syslog configuration?


--
Adrian Klaver
adrian.klaver@gmail.com


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: main.log file not being updated

От
Anson Abraham
Дата:
I though to do that w/ log_destination, but i left everything pretty much default except those params I mentioned earlier.

Interestingly i have another DB server (same ver, etc...) w/ exact same config params w/ postgres and sys log config and that is writing to the "system postgres log".


it's a head scratcher for me.

On Thu, Jan 24, 2013 at 4:08 PM, Adrian Klaver <adrian.klaver@gmail.com> wrote:
On 01/24/2013 12:44 PM, Anson Abraham wrote:
i've always had logging_collector off.  it would still log query /
transactions that failed to the "syslog"
(var/log/postgres/postgres-9.0-main.log).
the only thing I've changed was turning log_duration back to off.  But
I've gone back and forth with what, and doing a postgres reload.


CCing list.

Then shouldn't

log_destination = 'stderr'

be

log_destination = 'syslog'

You may also want to check that the syslog configuration has not changed and it is actually configured to catch the Postgres output.

Would not hurt to check the init.d script to see if it is overriding the logging settings.


Adrian Klaver
adrian.klaver@gmail.com

Re: main.log file not being updated

От
Anson Abraham
Дата:
no cluster, just 2 different independent/isolated DB servers.
As for location of logs, yes, it's the correct one, b/c when logrotate (through system), initiated I can see the other log files gzipped.  The install was done through ,what I believe, apt-get.

I guess it might require a bouncing of the instance, but that's something I don't have luxury of doing until the next maintanence window, which will be a ways in the future.

Thanks,
-Anson

On Fri, Jan 25, 2013 at 3:35 PM, Adrian Klaver <adrian.klaver@gmail.com> wrote:
On 01/25/2013 09:00 AM, Anson Abraham wrote:
identical.


This is on Debian correct?
Are you using the Debian pg_cluster system?
In particular are using pg_ctlcluster to start the server?

From what I remember of pg cluster is that the init.d script is called by pg_ctlcluster and the pg_ctcluster code takes care of setting up the logging to the appropriate log in /var/log/postgres. If you call the init script directly it just follows  whatever are the settings in postgresql.conf, which in your case would not actually log anything.


Another possibility.
Are you sure you are looking at the correct log?
One of the features of pg cluster is that there can be multiple versions of Postgres and multiple db clusters in a version. Again if I remember correctly main is the default cluster for a version.

Is it possible there is another cluster running PG 9.0?


--
Adrian Klaver
adrian.klaver@gmail.com

Re: main.log file not being updated

От
Adrian Klaver
Дата:
On 01/28/2013 10:38 AM, Anson Abraham wrote:
> no cluster, just 2 different independent/isolated DB servers.

On the same machine or different machines?

> As for location of logs, yes, it's the correct one, b/c when logrotate
> (through system), initiated I can see the other log files gzipped.  The
> install was done through ,what I believe, apt-get.

This is assuming the logging is set up properly. The issue is not on
with the ones that are working, but with one that is not. It is very
possible that it is not logging to where you think it is.

As to apt-get, have you done a dpkg -l|grep post to see what was installed?

I would say it is highly probable you are running up against pg_cluster.

Reason being, from your previous posts and the Debian
site(http://wiki.debian.org/PostgreSql):

Your log file:
postgresql-9.0-main.log
Debian policy
Log files: Installing PostgreSQL creates log directory
/var/log/postgresql/. Starting the database engine creates log file with
name postgresql-[version]-[cluster].log.


Your init script:
init.d/postgres

Debian
Debian installs SysV-init compatible (standard) start-up script
/etc/init.d/postgresql-[version]. It can be used to start, stop, restart
and reload the system. It calls pg_ctlcluster internally.

Note the difference in init script. Best guess is you are calling an
init script that is unaware of the Debian setup.

>
> I guess it might require a bouncing of the instance, but that's
> something I don't have luxury of doing until the next maintanence
> window, which will be a ways in the future.
>
> Thanks,
> -Anson



--
Adrian Klaver
adrian.klaver@gmail.com