Logging Queries

Started by Hunter Hillegasabout 25 years ago5 messagesgeneral
Jump to latest
#1Hunter Hillegas
lists@lastonepicked.com

I'm having a problem with queries sent in from a Java program.

Is there any way to have the server log the queries that are coming in so I
can see what's actually getting processed?

Hunter

#2Alex Howansky
alex@wankwood.com
In reply to: Hunter Hillegas (#1)
Re: Logging Queries

Is there any way to have the server log the queries that are coming in so I
can see what's actually getting processed?

Start the postmaster with "-d 2" on the command line.

--
Alex Howansky
Wankwood Associates
http://www.wankwood.com/

#3Peter T Mount
peter@retep.org.uk
In reply to: Hunter Hillegas (#1)
Re: [JDBC] Logging Queries

At 12:01 27/03/01 -0800, Hunter Hillegas wrote:

I'm having a problem with queries sent in from a Java program.

Is there any way to have the server log the queries that are coming in so I
can see what's actually getting processed?

From the server:
Can't remember which, but -d1 or -d2 when you start the postmaster
sometimes works (higher values show too much detail like the query plans etc).

From within the driver: use DriverManager.setLogStream()

PeterM

#4Eric Frazier
ef@kwinternet.com
In reply to: Peter T Mount (#3)
Re: [JDBC] Logging Queries

Hi,

Peter, is that new? I have used SetLogStream with your 7.1 beta 5 driver and
7.03 Postgress but didn't see any output from queries that I didn't put there?
Or could it have to do with my server config that I didn't see anything? I
mean no query info, I did see info on the driver and on the connection URLS etc.

Thanks,

Eric

At 10:20 AM 3/29/01 +0100, Peter Mount wrote:

At 12:01 27/03/01 -0800, Hunter Hillegas wrote:

I'm having a problem with queries sent in from a Java program.

Is there any way to have the server log the queries that are coming in so I
can see what's actually getting processed?

From the server:
Can't remember which, but -d1 or -d2 when you start the postmaster
sometimes works (higher values show too much detail like the query plans etc).

From within the driver: use DriverManager.setLogStream()

PeterM

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Frazier Consulting
http://www.kwinternet.com/eric
(250) 655 - 9513

#5Peter T Mount
peter@retep.org.uk
In reply to: Eric Frazier (#4)
Re: [JDBC] Logging Queries

Quoting Eric Frazier <ef@kwinternet.com>:

Hi,

Peter, is that new? I have used SetLogStream with your 7.1 beta 5 driver
and
7.03 Postgress but didn't see any output from queries that I didn't put
there?

No, it's been in there for a few years now.

Or could it have to do with my server config that I didn't see anything?
I
mean no query info, I did see info on the driver and on the connection
URLS etc.

No, it's a client side option. setLogStream() sets the stream that
DriverManager uses, then in the JDBC driver it calls DriverManager to write to
that log.

Peter

Thanks,

Eric

At 10:20 AM 3/29/01 +0100, Peter Mount wrote:

At 12:01 27/03/01 -0800, Hunter Hillegas wrote:

I'm having a problem with queries sent in from a Java program.

Is there any way to have the server log the queries that are coming in

so I

can see what's actually getting processed?

From the server:
Can't remember which, but -d1 or -d2 when you start the postmaster
sometimes works (higher values show too much detail like the query

plans etc).

From within the driver: use DriverManager.setLogStream()

PeterM

---------------------------(end of

broadcast)---------------------------

TIP 1: subscribe and unsubscribe commands go to

majordomo@postgresql.org

Frazier Consulting
http://www.kwinternet.com/eric
(250) 655 - 9513

--
Peter Mount peter@retep.org.uk
PostgreSQL JDBC Driver: http://www.retep.org.uk/postgres/
RetepPDF PDF library for Java: http://www.retep.org.uk/pdf/