Thread: logging messages this time

logging messages this time

From
"Eric S. Johansson"
Date:
I'd like to thank folks who helped me with the authentication problem I
had earlier.  I may have been asking the wrong question about, as they
say, learning is never wasted.  Now in order to keep from asking the
wrong question again, I'm trying to get logging working so I can observe
more closely what is failing and make a more appropriate diagnosis.

I went to the administrative manual and found the documentation on the
various logging options.  It seems like what I want (diagnostic logging
of traffic) would be had by the following settings in postgresql.conf:

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

log_connections = true
log_pid = false
log_statement = true
log_duration = false
#log_timestamp = false

#log_min_error_statement = error # Values in order of increasing severity:

and....

syslog = 2                      # range 0-2
syslog_facility = 'LOCAL0'
syslog_ident = 'postgres'


when I run my tests, all I get in /var/log/messages is:

Oct 28 16:33:03 relay2 su(pam_unix)[2124]: session opened for user
postgres by (uid=0)
Oct 28 16:33:03 relay2 postgres[2163]: [1] LOG:  database system was
shut down at 2003-10-28 16:33:02 EST
Oct 28 16:33:03 relay2 postgres[2163]: [2] LOG:  checkpoint record is at
0/87F348
Oct 28 16:33:03 relay2 postgres[2163]: [3] LOG:  redo record is at
0/87F348; undo record is at 0/0; shutdown T
UE
Oct 28 16:33:03 relay2 postgres[2163]: [4] LOG:  next transaction id:
737; next oid: 17010
Oct 28 16:33:03 relay2 su(pam_unix)[2124]: session closed for user postgres
Oct 28 16:33:03 relay2 postgres[2163]: [5] LOG:  database system is ready
Oct 28 16:33:04 relay2 postgresql: Starting postgresql service:  succeeded

which looks like the basic startup transaction from the startup script.
  When I run the application (horde/turba) I get nothing further out of
the log.  obviously, there's an understanding gap.  Whatever feedback I
get, I will try to turn into a summary that could be used as part of the
documentation if you should want it.

---eric

--
Speech recognition in use.  Incorrect endings, words, and case is
closer than it appears


Re: logging messages this time

From
Tom Lane
Date:
"Eric S. Johansson" <esj@harvee.org> writes:
> ... I'm trying to get logging working so I can observe
> more closely what is failing and make a more appropriate diagnosis.

Turning on log_connections and log_statement certainly ought to produce
more output than you are getting.  I wonder if maybe you are editing the
wrong copy of postgresql.conf --- people have made that mistake before.
The right copy is the one in the PGDATA directory (-D postmaster argument).
Don't forget that you need to either SIGHUP or restart the postmaster to
get it to take notice of changes in postgresql.conf.

            regards, tom lane

Re: logging messages this time

From
"Eric S. Johansson"
Date:
Tom, thanks for the reply.

Tom Lane wrote:

> Turning on log_connections and log_statement certainly ought to produce
> more output than you are getting.  I wonder if maybe you are editing the
> wrong copy of postgresql.conf --- people have made that mistake before.
> The right copy is the one in the PGDATA directory (-D postmaster argument).
> Don't forget that you need to either SIGHUP or restart the postmaster to
> get it to take notice of changes in postgresql.conf.

I double checked.  First, I'm editing the file that was created when I
initialized the database as a side effect of the first time it was
started, and second, confirmed the location by looking as you suggested
in the startup script for the -D argument.

as for restarting, I was trying pg_ctl reload but that didn't seem to
work so I use the init script to stop and start postmaster.

This is a weird one.  I'm probably missing something really basic that I
don't even know enough to describe or look for in the manual.  From what
I understand, I needed to turn on the various logging statements and
syslog configuration statements then restart postmaster and I should be
able to get logged messages, right?

---eric

--
Speech recognition in use.  Incorrect endings, words, and case is
closer than it appears


Re: logging messages this time

From
Ennio-Sr
Date:
* Eric S. Johansson <esj@harvee.org> [291003, 13:44]:
> [...]
> This is a weird one.  I'm probably missing something really basic that I
> don't even know enough to describe or look for in the manual.  From what
> I understand, I needed to turn on the various logging statements and
> syslog configuration statements then restart postmaster and I should be
> able to get logged messages, right?
>

I'm the last person that can advice somebody ... but, do have a look at
this, it might help :-)
-------------
$ head -30 /etc/postgresql/postmaster.conf
# /etc/postgresql/postmaster.conf
#
[...]
(about row 22)
# Where to find the PostgreSQL database files, including those that
# define PostgresSQL users and permissions.
# POSTGRES_DATA=/var/lib/postgres/data

# Where to send logging and debugging traces.  By default, very little
# should appear here, because SYSLOG is set to 2 in postgresql.conf, so
# that all messages are sent to syslog only.
# POSTGRES_LOG=/var/log/postgres.log
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--------------

Regards,
    Ennio

--
[Perche' usare Win$ozz (dico io) se ..."anche uno sciocco sa farlo.     \\?//
 Fa' qualche cosa di cui non sei capace!"   (diceva Henry Miller) ]     (°|°)
[Why to use Win$ozz (I say) if ... "even a fool can do that.             )=(
 Do something you aren't good at!" (used to say Henry Miller) ]

Re: logging messages this time

From
Tom Lane
Date:
"Eric S. Johansson" <esj@harvee.org> writes:
> This is a weird one.  I'm probably missing something really basic that I
> don't even know enough to describe or look for in the manual.

Hmm ... thinking about "really basic" ... are you removing the comment
character '#' from in front of the entries you want to change?

            regards, tom lane

Re: logging messages this time

From
"Eric S. Johansson"
Date:
Tom Lane wrote:

> "Eric S. Johansson" <esj@harvee.org> writes:
>
>>This is a weird one.  I'm probably missing something really basic that I
>>don't even know enough to describe or look for in the manual.
>
>
> Hmm ... thinking about "really basic" ... are you removing the comment
> character '#' from in front of the entries you want to change?
>
>             regards, tom lane

certainly did.  And I changed syslog to 2 so I would redirect all
logging output to syslog.  this has me wondering.  Somebody else pointed
me at a postmaster.conf file which I don't believe I have.  Could this
be some artifact of the Red Hat 9 version (postgresql-7.3.2-3)?

--- configuration file changes ---

#
#       Message display
#
server_min_messages = info      # Values, in order of decreasing detail:
                                 #   debug5, debug4, debug3, debug2, debug1,
                                 #   info, notice, warning, error, log,
fatal,
                                 #   panic
client_min_messages = notice    # Values, in order of decreasing detail:
                                 #   debug5, debug4, debug3, debug2, debug1,
                                 #   log, info, notice, warning, error
silent_mode = false

log_connections = true
log_pid = false
log_statement = true
log_duration = false
#log_timestamp = false

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

#debug_print_parse = false
#debug_print_rewritten = false
#debug_print_plan = false
#debug_pretty_print = false

#explain_pretty_print = true

# requires USE_ASSERT_CHECKING
#debug_assertions = true


#
#       Syslog
#
syslog = 2                      # range 0-2
syslog_facility = 'LOCAL0'
syslog_ident = 'postgres'



--
Speech recognition in use.  Incorrect endings, words, and case is
closer than it appears


Re: logging messages this time

From
Oliver Elphick
Date:
On Wed, 2003-10-29 at 20:06, Eric S. Johansson wrote:
> ...  Somebody else pointed
> me at a postmaster.conf file which I don't believe I have.  Could this
> be some artifact of the Red Hat 9 version (postgresql-7.3.2-3)?

postmaster.conf is part of Debian's packaging.

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Now unto him that is able to do exceeding abundantly
      above all that we ask or think, according to the power
      that worketh in us..."            Ephesians 3:20