Thread: System Log

System Log

From
"Duncan Garland"
Date:
Hi,

I'm sorry to be dim about this, but I've always got by without the system
log before and now I suddenly need one quite urgently.

The relevant part of the configuration file (postgresql.conf) was:
#---------------------------------------------------------------------------
# ERROR REPORTING AND LOGGING
#---------------------------------------------------------------------------

# - Syslog -

syslog = 2                      # range 0-2; 0=stdout; 1=both; 2=syslog
syslog_facility = 'LOCAL0'
syslog_ident = 'postgres'

# - When to Log -

#client_min_messages = notice   # Values, in order of decreasing detail:
                                #   debug5, debug4, debug3, debug2, debug1,
                                #   log, info, notice, warning, error

#log_min_messages = notice      # Values, in order of decreasing detail:
                                #   debug5, debug4, debug3, debug2, debug1,
                                #   info, notice, warning, error, log,
fatal,
                                #   panic

#log_error_verbosity = default   # terse, default, or verbose messages

#log_min_error_statement = panic # Values in order of increasing severity:
                                 #   debug5, debug4, debug3, debug2, debug1,
                                 #   info, notice, warning, error,
panic(off)

#log_min_duration_statement = -1 # Log all statements whose
                                 # execution time exceeds the value, in
                                 # milliseconds.  Zero prints all queries.
                                 # Minus-one disables.

silent_mode = true               # DO NOT USE without Syslog!

# - What to Log -

#debug_print_parse = false
#debug_print_rewritten = false
#debug_print_plan = false
#debug_pretty_print = false
#log_connections = false
#log_duration = false
#log_pid = false
#log_statement = false
#log_timestamp = false
#log_hostname = false
#log_source_port = false

That looks clear enough. The logging was switched off, so I've changed it
to:

#---------------------------------------------------------------------------
# ERROR REPORTING AND LOGGING
#---------------------------------------------------------------------------

# - Syslog -

syslog = 2                      # range 0-2; 0=stdout; 1=both; 2=syslog
syslog_facility = 'LOCAL0'
syslog_ident = 'postgres'

# - When to Log -

client_min_messages = notice    # Values, in order of decreasing detail:
                                #   debug5, debug4, debug3, debug2, debug1,
                                #   log, info, notice, warning, error

log_min_messages = notice       # Values, in order of decreasing detail:
                                #   debug5, debug4, debug3, debug2, debug1,
                                #   info, notice, warning, error, log,
fatal,
                                #   panic

log_error_verbosity = default   # terse, default, or verbose messages

#log_min_error_statement = panic # Values in order of increasing severity:
                                 #   debug5, debug4, debug3, debug2, debug1,
                                 #   info, notice, warning, error,
panic(off)

log_min_duration_statement = 0 # Log all statements whose
                                 # execution time exceeds the value, in
                                 # milliseconds.  Zero prints all queries.
                                 # Minus-one disables.

silent_mode = false              # DO NOT USE without Syslog!

# - What to Log -

debug_print_parse = false
debug_print_rewritten = false
debug_print_plan = false
debug_pretty_print = false
log_connections = false
log_duration = false
log_pid = false
log_statement = false
log_timestamp = false
log_hostname = false
log_source_port = false

I then restarted the server. No difference. I'm assuming the log file is
postmaster.log.

I'm obviously missing something very simple. Any ideas?


Re: System Log

From
Tom Lane
Date:
"Duncan Garland" <duncan.garland@ntlworld.com> writes:
> The relevant part of the configuration file (postgresql.conf) was:
> syslog = 2                      # range 0-2; 0=stdout; 1=both; 2=syslog
> syslog_facility = 'LOCAL0'
> syslog_ident = 'postgres'

> I then restarted the server. No difference. I'm assuming the log file is
> postmaster.log.

No, given those settings, the messages are going to go wherever your
system's syslog daemon is configured to write "local0" messages.
Possibly /var/log/messages, but this is something that varies wildly
across different platforms ... "man syslogd" should lead you to the
configuration file that determines it.

            regards, tom lane

Re: System Log

From
"Duncan Garland"
Date:
Hi Tom,

Thanks for the quick reply. I don't think the messages are configured to go
anywhere. Have you got a simple example I could copy? Or is there a simple
guide somewhere?

The current files is:

# $FreeBSD: src/etc/syslog.conf,v 1.13.2.3 2002/04/15 00:44:13 dougb Exp $
#
#       Spaces ARE valid field separators in this file. However,
#       other *nix-like systems still insist on using tabs as field
#       separators. If you are sharing this file between systems, you
#       may want to use only tabs as field separators here.
#       Consult the syslog.conf(5) manpage.
*.notice;lpr.info;mail.crit;news.err            /var/log/messages
security.*                                      /var/log/security
auth.info;authpriv.info                         /var/log/auth.log
mail.info                                       /var/log/maillog
lpr.info                                        /var/log/lpd-errs
cron.*                                          /var/log/cron
*.emerg                                         *
# uncomment this to enable logging of all log messages to /var/log/all.log
# touch /var/log/all.log and chmod it to mode 600 before it will work
#*.*                                            /var/log/all.log
# uncomment this to enable logging to a remote loghost named loghost
#*.*                                            @loghost
# uncomment these if you're running inn
# news.crit                                     /var/log/news/news.crit
# news.err                                      /var/log/news/news.err
# news.notice                                   /var/log/news/news.notice

Do I add

postgres.*                            /var/log/postmaster.log

or perhaps

LOCAL0.*                            /var/log/postmaster.log

Regards

Duncan
-----Original Message-----
From: pgsql-novice-owner@postgresql.org
[mailto:pgsql-novice-owner@postgresql.org]On Behalf Of Tom Lane
Sent: 09 March 2007 16:24
To: Duncan Garland
Cc: pgsql-novice@postgresql.org
Subject: Re: [NOVICE] System Log


"Duncan Garland" <duncan.garland@ntlworld.com> writes:
> The relevant part of the configuration file (postgresql.conf) was:
> syslog = 2                      # range 0-2; 0=stdout; 1=both; 2=syslog
> syslog_facility = 'LOCAL0'
> syslog_ident = 'postgres'

> I then restarted the server. No difference. I'm assuming the log file is
> postmaster.log.

No, given those settings, the messages are going to go wherever your
system's syslog daemon is configured to write "local0" messages.
Possibly /var/log/messages, but this is something that varies wildly
across different platforms ... "man syslogd" should lead you to the
configuration file that determines it.

            regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

                http://www.postgresql.org/about/donate


Re: System Log

From
"Larry Rosenman"
Date:
here is my line from a FreeBSD 6.2 system:
local0.*                                        /var/log/pg-prod.log


and I add a local0.none to the /var/log/messages line so it doesn't get
spammed by the pg messages.

LER

--
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 512-248-2683                E-Mail: ler@lerctr.org
US Mail: 430 Valona Loop, Round Rock, TX 78681-3893


-----Original Message-----
From: pgsql-novice-owner@postgresql.org
[mailto:pgsql-novice-owner@postgresql.org] On Behalf Of Duncan Garland
Sent: Friday, March 09, 2007 11:02 AM
To: Tom Lane
Cc: pgsql-novice@postgresql.org
Subject: Re: [NOVICE] System Log

Hi Tom,

Thanks for the quick reply. I don't think the messages are configured to go
anywhere. Have you got a simple example I could copy? Or is there a simple
guide somewhere?

The current files is:

# $FreeBSD: src/etc/syslog.conf,v 1.13.2.3 2002/04/15 00:44:13 dougb Exp $
#
#       Spaces ARE valid field separators in this file. However,
#       other *nix-like systems still insist on using tabs as field
#       separators. If you are sharing this file between systems, you
#       may want to use only tabs as field separators here.
#       Consult the syslog.conf(5) manpage.
*.notice;lpr.info;mail.crit;news.err            /var/log/messages
security.*                                      /var/log/security
auth.info;authpriv.info                         /var/log/auth.log
mail.info                                       /var/log/maillog
lpr.info                                        /var/log/lpd-errs
cron.*                                          /var/log/cron
*.emerg                                         *
# uncomment this to enable logging of all log messages to /var/log/all.log
# touch /var/log/all.log and chmod it to mode 600 before it will work
#*.*                                            /var/log/all.log
# uncomment this to enable logging to a remote loghost named loghost
#*.*                                            @loghost
# uncomment these if you're running inn
# news.crit                                     /var/log/news/news.crit
# news.err                                      /var/log/news/news.err
# news.notice                                   /var/log/news/news.notice

Do I add

postgres.*
/var/log/postmaster.log

or perhaps

LOCAL0.*
/var/log/postmaster.log

Regards

Duncan
-----Original Message-----
From: pgsql-novice-owner@postgresql.org
[mailto:pgsql-novice-owner@postgresql.org]On Behalf Of Tom Lane
Sent: 09 March 2007 16:24
To: Duncan Garland
Cc: pgsql-novice@postgresql.org
Subject: Re: [NOVICE] System Log


"Duncan Garland" <duncan.garland@ntlworld.com> writes:
> The relevant part of the configuration file (postgresql.conf) was:
> syslog = 2                      # range 0-2; 0=stdout; 1=both; 2=syslog
> syslog_facility = 'LOCAL0'
> syslog_ident = 'postgres'

> I then restarted the server. No difference. I'm assuming the log file is
> postmaster.log.

No, given those settings, the messages are going to go wherever your
system's syslog daemon is configured to write "local0" messages.
Possibly /var/log/messages, but this is something that varies wildly
across different platforms ... "man syslogd" should lead you to the
configuration file that determines it.

            regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

                http://www.postgresql.org/about/donate


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match


Re: System Log

From
Tom Lane
Date:
"Duncan Garland" <duncan.garland@ntlworld.com> writes:
> Do I add
> LOCAL0.*                            /var/log/postmaster.log

That, I believe.

            regards, tom lane

Re: System Log

From
"Duncan Garland"
Date:
Hi,

Isn't it case sensitive? There's one suggestion of LOCAL0.* and one of
local0.*.

I can't get this thing to produce a log file. Is the configuration file
definately right? I've logged a request elsewhere about the syslog process.

Thanks

-----Original Message-----
From: pgsql-novice-owner@postgresql.org
[mailto:pgsql-novice-owner@postgresql.org]On Behalf Of Tom Lane
Sent: 09 March 2007 18:15
To: Duncan Garland
Cc: pgsql-novice@postgresql.org
Subject: Re: [NOVICE] System Log


"Duncan Garland" <duncan.garland@ntlworld.com> writes:
> Do I add
> LOCAL0.*                            /var/log/postmaster.log

That, I believe.

            regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@postgresql.org so that your
       message can get through to the mailing list cleanly


Re: System Log

From
Tom Lane
Date:
"Duncan Garland" <duncan.garland@ntlworld.com> writes:
> Isn't it case sensitive? There's one suggestion of LOCAL0.* and one of
> local0.*.

No idea.

> I can't get this thing to produce a log file. Is the configuration file
> definately right? I've logged a request elsewhere about the syslog process.

Did you remember to SIGHUP the syslog daemon after changing its config
file?

            regards, tom lane

Re: System Log

From
"Duncan Garland"
Date:
> Did you remember to SIGHUP the syslog daemon after changing its config
> file?

Yes.

ps -ax | grep -i syslog
51306  ??  Ss     3:23.93 /usr/sbin/syslogd -ss

kill -s HUP 51306

>> Isn't it case sensitive? There's one suggestion of LOCAL0.* and one of
>> local0.*.
>
> No idea.

I've tried both to no avail.

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: 09 March 2007 20:36
To: Duncan Garland
Cc: pgsql-novice@postgresql.org
Subject: Re: [NOVICE] System Log


"Duncan Garland" <duncan.garland@ntlworld.com> writes:
> Isn't it case sensitive? There's one suggestion of LOCAL0.* and one of
> local0.*.

No idea.

> I can't get this thing to produce a log file. Is the configuration file
> definately right? I've logged a request elsewhere about the syslog
process.

Did you remember to SIGHUP the syslog daemon after changing its config
file?

            regards, tom lane