pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Logging
11+ messages / 11 participants
[nested] [flat]

* Logging
@ 2000-11-20 18:57 Anders R. Sveen <anderssv@stud.ntnu.no>
  2000-11-20 19:57 ` Re: Logging Lamar Owen <lamar.owen@wgcr.org>
  2000-11-22 20:25 ` Re: [GENERAL] Logging Oliver Elphick <olly@lfix.co.uk>
  0 siblings, 2 replies; 11+ messages in thread

From: Anders R. Sveen @ 2000-11-20 18:57 UTC (permalink / raw)
  To: pgsql-admin

Hey,

I've set my pg_options file to write log messages, but it only logs to
/var/log/messages instead of /var/log/postgresql wich remains empty. 

Why is that and how can i change it? Maybe it's a sylog question, but
beeing new to it and all i can't really figure things out.

I've installed the 7.0.3-1 rpm on an RedHat 6.2 system.

Thanks,
Anders,




^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: Logging
  2000-11-20 18:57 Logging Anders R. Sveen <anderssv@stud.ntnu.no>
@ 2000-11-20 19:57 ` Lamar Owen <lamar.owen@wgcr.org>
  1 sibling, 0 replies; 11+ messages in thread

From: Lamar Owen @ 2000-11-20 19:57 UTC (permalink / raw)
  To: Anders R. Sveen <anderssv@stud.ntnu.no>; +Cc: pgsql-admin

"Anders R. Sveen" wrote:
> I've set my pg_options file to write log messages, but it only logs to
> /var/log/messages instead of /var/log/postgresql wich remains empty.
 
> Why is that and how can i change it? Maybe it's a sylog question, but
> beeing new to it and all i can't really figure things out.

You need to edit /etc/syslog.conf to direct the output of PostgreSQL to
the file you wish to hold the log.  The facility used by default in
7.0.3 is local0, so a line:
local0.*                /var/log/postgresql
will do what you expect.
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: [GENERAL] Logging
  2000-11-20 18:57 Logging Anders R. Sveen <anderssv@stud.ntnu.no>
@ 2000-11-22 20:25 ` Oliver Elphick <olly@lfix.co.uk>
  1 sibling, 0 replies; 11+ messages in thread

From: Oliver Elphick @ 2000-11-22 20:25 UTC (permalink / raw)
  To: Anders R. Sveen <anderssv@stud.ntnu.no>; +Cc: pgsql-admin

"Anders R. Sveen" wrote:
  >Hey,
  >
  >I've set my pg_options file to write log messages, but it only logs to
  >/var/log/messages instead of /var/log/postgresql wich remains empty. 
  >
  >Why is that and how can i change it? Maybe it's a sylog question, but
  >beeing new to it and all i can't really figure things out.

The docs say: Messages printed to syslog use the log facility LOG_LOCAL0.

You need to configure syslogd to send those messages to postgresql; edit
/etc/syslog.conf (see the man page for syslogd and syslog.conf) to
contain something like:

   local0.*   -/var/log/postgresql

You may want to change this to be more selective...

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Can two walk together, except they be agreed?"   
                                     Amos 3:3 





^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* logging
@ 2002-09-25 14:14 Devinder K Rajput <Devinder.Rajput@ipaper.com>
  2002-09-25 18:40 ` Re: logging Andrew Sullivan <andrew@libertyrms.info>
  0 siblings, 1 reply; 11+ messages in thread

From: Devinder K Rajput @ 2002-09-25 14:14 UTC (permalink / raw)
  To: pgsql-admin

Hi all,

I am trying to setup logging.  I have updated the postgresql.conf by making
the following changes:

#debug_level = 0 # range 0-16
debug_level = 2 # range 0-16

#debug_print_query = false
debug_print_query = true
...

#       Syslog
#
#ifdef ENABLE_SYSLOG
#syslog = 0 # range 0-2
syslog = 2 # range 0-2

I have also update the postgresql script that we use to start postmaster to
redirect output to a log file rather than /dev/null.  I get the following
in the log file:

postmaster successfully started
invoking IpcMemoryCreate(size=1236992)
FindExec: found "/usr/bin/postmaster" using argv[0]
/usr/bin/postmaster: reaping dead processes...
/usr/bin/postmaster: ServerLoop:                handling reading 5
/usr/bin/postmaster: ServerLoop:                handling reading 5
/usr/bin/postmaster: ServerLoop:                handling reading 5
/usr/bin/postmaster: ServerLoop:                handling reading 5
/usr/bin/postmaster: ServerLoop:                handling writing 5
/usr/bin/postmaster: BackendStartup: pid 30039 user postgres db dioh socket
5
/usr/bin/postmaster child[30039]: starting with (postgres -d2 -v131072 -p
dioh )
FindExec: found "/usr/bin/postgres" using argv[0]
/usr/bin/postmaster: reaping dead processes...
/usr/bin/postmaster: CleanupProc: pid 30039 exited with status 0
/usr/bin/postmaster: ServerLoop:                handling reading 5
/usr/bin/postmaster: ServerLoop:                handling reading 5
/usr/bin/postmaster: ServerLoop:                handling reading 5
/usr/bin/postmaster: ServerLoop:                handling reading 5
/usr/bin/postmaster: ServerLoop:                handling writing 5
/usr/bin/postmaster: BackendStartup: pid 30054 user postgres db
counterpoint soc
ket 5
/usr/bin/postmaster child[30054]: starting with (postgres -d2 -v131072 -p
counte
rpoint )
....

I want the log file to show activity that occurs when queries are executed.
But this seems to be only showing output when I open a psql session or log
out of it.  Could you please kindly let me know what I am missing.  Thank
you.

p.s. The whole reason for turning on logging is that we are processing
sales data from about 100 locations to generate inventory numbers.  The
program runs fine for all but 1 store.  The problem is that postmaster
keeps on running for about 3 days processing something when it only should
take about 30 mintues.  I figured maybe logging will show what postmaster
is doing while it's on its 3 day cruise.


Devinder Rajput
Stores Division Corporate Offices
Chicago, IL
(773) 442-6474




^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: logging
  2002-09-25 14:14 logging Devinder K Rajput <Devinder.Rajput@ipaper.com>
@ 2002-09-25 18:40 ` Andrew Sullivan <andrew@libertyrms.info>
  0 siblings, 0 replies; 11+ messages in thread

From: Andrew Sullivan @ 2002-09-25 18:40 UTC (permalink / raw)
  To: pgsql-admin

On Wed, Sep 25, 2002 at 09:14:36AM -0500, Devinder K Rajput wrote:
> 
> #       Syslog
> #
> #ifdef ENABLE_SYSLOG
> #syslog = 0 # range 0-2
> syslog = 2 # range 0-2

You've sent the logs to syslog, although some messages go to STDERR
anyway.  If your syslog is not configured to do something with the
messages, it's probably all ending up in /path/to/system/logs/syslog
or something like that.

A

-- 
----
Andrew Sullivan                         204-4141 Yonge Street
Liberty RMS                           Toronto, Ontario Canada
<andrew@libertyrms.info>                              M2P 2A8
                                         +1 416 646 3304 x110




^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* logging
@ 2004-10-01 06:54 Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>
  2004-10-01 08:37 ` Re: logging Gaetano Mendola <mendola@bigfoot.com>
  0 siblings, 1 reply; 11+ messages in thread

From: Theo Galanakis @ 2004-10-01 06:54 UTC (permalink / raw)
  To: pgsql-admin


I'm currently logging postgres dubugging to syslogs and wanted to know if it
is possible to log which database each log entry is refering to? At the
moment it looks something like this :

Sep 30 02:49:59 tickle postgres[31285]: [31-1] LOG:  statement: select *
from content_objects^M
Sep 30 02:49:59 tickle postgres[31285]: [31-2] ^I^I^I^Iwhere
content_object_id = ^M
Sep 30 02:49:59 tickle postgres[31285]: [31-3] ^I^I^I^I^I'680'
Sep 30 02:49:59 tickle postgres[31285]: [32-1] LOG:  duration: 1.147 ms

I was thinking of perhaps looking at the table in the sql and trying to
match it up the information_schema.columns and obtain the database from
that! However I thought that if there was a debugging option available it
would save a heap of time.

Theo


______________________________________________________________________
This email, including attachments, is intended only for the addressee
and may be confidential, privileged and subject to copyright.  If you
have received this email in error, please advise the sender and delete
it.  If you are not the intended recipient of this email, you must not
use, copy or disclose its content to anyone.  You must not copy or 
communicate to others content that is confidential or subject to 
copyright, unless you have the consent of the content owner.

^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: logging
  2004-10-01 06:54 logging Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>
@ 2004-10-01 08:37 ` Gaetano Mendola <mendola@bigfoot.com>
  0 siblings, 0 replies; 11+ messages in thread

From: Gaetano Mendola @ 2004-10-01 08:37 UTC (permalink / raw)
  To: Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>

Theo Galanakis wrote:
> I'm currently logging postgres dubugging to syslogs and wanted to know 
> if it is possible to log which database each log entry is refering to? 
> At the moment it looks something like this :
> 
> Sep 30 02:49:59 tickle postgres[31285]: [31-1] LOG:  statement: select * 
> from content_objects^M
> Sep 30 02:49:59 tickle postgres[31285]: [31-2] ^I^I^I^Iwhere 
> content_object_id = ^M
> Sep 30 02:49:59 tickle postgres[31285]: [31-3] ^I^I^I^I^I'680'
> Sep 30 02:49:59 tickle postgres[31285]: [32-1] LOG:  duration: 1.147 ms
> 
> I was thinking of perhaps looking at the table in the sql and trying to 
> match it up the information_schema.columns and obtain the database from 
> that! However I thought that if there was a debugging option available 
> it would save a heap of time.

Unfortunately I have to say that is impossible to do it for version < 8.0
( that BTW is still in beta phase ).


Regards
Gaetano Mendola





^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* logging
@ 2008-10-03 22:16 Marc Fromm <Marc.Fromm@wwu.edu>
  2008-10-06 08:17 ` Re: logging IJS/System - Joko <system@ijs.co.id>
  0 siblings, 1 reply; 11+ messages in thread

From: Marc Fromm @ 2008-10-03 22:16 UTC (permalink / raw)
  To: pgsql-admin

We would like to log sql activity from our web pages that use postgresql databases.
I read the documentation for 8.1 at postgresql.org. The postgresql.conf file under the -Where to log- section has
#log_destination = 'stderr'
Is stderr the default or do I need to remove the comment symbol to actually start logging to stderr?
Are there recommended settings for all the different items in where to log, when to log, and what to log?

Our goal is to capture errors like when someone claims to have submitted data, yet it is not in the database, and the record count skips an increment-5360 then 5362, missing 5361.

Thanks


Marc

^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: logging
  2008-10-03 22:16 logging Marc Fromm <Marc.Fromm@wwu.edu>
@ 2008-10-06 08:17 ` IJS/System - Joko <system@ijs.co.id>
  0 siblings, 0 replies; 11+ messages in thread

From: IJS/System - Joko @ 2008-10-06 08:17 UTC (permalink / raw)
  To: pgsql-admin

yes, remove the comment character.

And further more, find my email post with subject "log_statement at 
postgres.conf"

Regards,
Joko [IT/EDP]
PT. Indra Jaya Swastika
Phone: +62 31 7481388  Ext 201
http://www.ijs.co.id



Marc Fromm wrote:
>
> We would like to log sql activity from our web pages that use 
> postgresql databases.
>
> I read the documentation for 8.1 at postgresql.org. The 
> postgresql.conf file under the -Where to log- section has
>
> #log_destination = 'stderr'
>
> Is stderr the default or do I need to remove the comment symbol to 
> actually start logging to stderr?
>
> Are there recommended settings for all the different items in where to 
> log, when to log, and what to log?
>
>  
>
> Our goal is to capture errors like when someone claims to have 
> submitted data, yet it is not in the database, and the record count 
> skips an increment---5360 then 5362, missing 5361.
>
>  
>
> Thanks
>
>  
>
>  
>
> Marc
>
>  
>


--
If you have any problem with our services ,
please contact us at 70468146 or e-mail: helpdesk@ijs.co.id
PT Indra Jaya Swastika | Jl. Kalianak Barat 57A | +62-31-7481388

^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* logging
@ 2011-05-06 14:52 Campbell, Lance <lance@illinois.edu>
  2011-05-06 15:12 ` Re: logging Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 11+ messages in thread

From: Campbell, Lance @ 2011-05-06 14:52 UTC (permalink / raw)
  To: pgsql-admin

I currently use PostgreSQL 8.4.x.  

 

Below is a message I see in my logs.  How can I display the values for
$1, $2, etc. within the logs?

 

ERROR:  duplicate key value violates unique constraint "table_name_pkey"

STATEMENT:  insert into schema_name.table_name(field1, field2, field3,
field4, field5) values($1, $2, $3, $4, $5)

 

Thanks,

 

Lance Campbell

Software Architect/Project Manager/DBA

University of Illinois

 

^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: logging
  2011-05-06 14:52 logging Campbell, Lance <lance@illinois.edu>
@ 2011-05-06 15:12 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 11+ messages in thread

From: Tom Lane @ 2011-05-06 15:12 UTC (permalink / raw)
  To: Campbell, Lance <lance@illinois.edu>; +Cc: pgsql-admin

"Campbell, Lance" <lance@illinois.edu> writes:
> I currently use PostgreSQL 8.4.x.  
> Below is a message I see in my logs.  How can I display the values for
> $1, $2, etc. within the logs?
> ERROR:  duplicate key value violates unique constraint "table_name_pkey"

Update to 9.0.x.  There's no capability for this before that.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 11+ messages in thread


end of thread, other threads:[~2011-05-06 15:12 UTC | newest]

Thread overview: 11+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-11-20 18:57 Logging Anders R. Sveen <anderssv@stud.ntnu.no>
2000-11-20 19:57 ` Lamar Owen <lamar.owen@wgcr.org>
2000-11-22 20:25 ` Oliver Elphick <olly@lfix.co.uk>
2002-09-25 14:14 logging Devinder K Rajput <Devinder.Rajput@ipaper.com>
2002-09-25 18:40 ` Re: logging Andrew Sullivan <andrew@libertyrms.info>
2004-10-01 06:54 logging Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>
2004-10-01 08:37 ` Re: logging Gaetano Mendola <mendola@bigfoot.com>
2008-10-03 22:16 logging Marc Fromm <Marc.Fromm@wwu.edu>
2008-10-06 08:17 ` Re: logging IJS/System - Joko <system@ijs.co.id>
2011-05-06 14:52 logging Campbell, Lance <lance@illinois.edu>
2011-05-06 15:12 ` Re: logging Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox