Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id E1D7264FD0C for ; Fri, 18 Jul 2008 03:15:03 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 81617-04 for ; Fri, 18 Jul 2008 03:14:55 -0300 (ADT) X-Greylist: delayed 00:26:45.241567 by SQLgrey-1.7.6 Received: from unicorn.sby.dnet.net.id (unicorn.sby.dnet.net.id [202.148.11.52]) by postgresql.org (Postfix) with ESMTP id 935E464FD09 for ; Fri, 18 Jul 2008 03:14:54 -0300 (ADT) Received: from unicorn.sby.dnet.net.id (localhost [127.0.0.1]) by unicorn.sby.dnet.net.id (Postfix) with ESMTP id CAF9223A063A for ; Fri, 18 Jul 2008 12:48:03 +0700 (WIT) Received: from neptunus.sby.dnet.net.id (neptunus.sby.dnet.net.id [202.148.11.37]) by unicorn.sby.dnet.net.id (Postfix) with ESMTP id BB0F523A05FD for ; Fri, 18 Jul 2008 12:48:03 +0700 (WIT) Received: from ijs.co.id (unknown [202.148.12.194]) by neptunus.sby.dnet.net.id (Postfix) with ESMTP id B425A97EC9 for ; Fri, 18 Jul 2008 12:48:02 +0700 (WIT) Received: from edp03 ([192.140.6.18]) by ijs.co.id (ijs.co.id [192.140.6.10]) (MDaemon.PRO.v6.8.5.R) with ESMTP id 12-md50000000012.tmp for ; Fri, 18 Jul 2008 12:47:01 +0700 Message-ID: <014d01c8e899$dc597670$12068cc0@edp03> Reply-To: "System/IJS - Joko" From: "System/IJS - Joko" To: References: <01a601c8e7e9$41ad45d0$12068cc0@edp03> Subject: Re: log_statement at postgres.conf Date: Fri, 18 Jul 2008 12:48:10 +0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_014A_01C8E8D4.88AC6790" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-MDRemoteIP: 192.140.6.18 X-Return-Path: system@ijs.co.id X-MDaemon-Deliver-To: pgsql-performance@postgresql.org X-Spam-Processed: ijs.co.id, Fri, 18 Jul 2008 12:47:06 +0700 X-Virus-Scanned: ClamAV using ClamSMTP X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200807/145 X-Sequence-Number: 30745 This is a multi-part message in MIME format. ------=_NextPart_000_014A_01C8E8D4.88AC6790 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable >> I added the following to FreeBSD: >> >> /etc/newsyslog.conf: >> /var/log/postgresql 600 7 * @T00 JC make new file? >> /etc/syslog.conf: >> local0.* /var/log/postgresql >> >> /usr/local/pgsql/data/postgresql.conf: >> log_destination =3D 'syslog' >> syslog_facility =3D 'LOCAL0' >> syslog_ident =3D 'postgres' >> log_min_duration_statement =3D 100 # -1 is disabled, 0 logs = all >> statements, in ms. I already do this, but i can't find my log file FYI, i just wanna to log every SQL statement. >> Remember to touch /var/log/postgresql before restarting syslogd (kill >> -HUP syslog-pid). Chmod 0700 so only root can read the log-file. >> Adjust log_min_duration_statement to your needs. i don't understand "to touch /var/log/postgresql" > Hello, >=20 > another possibility is to have logs stored in a file by just changing=20 > 'redirect_stderr' to 'on' and 'log_destination' to 'stderr'. >=20 > This way, with the default config, all logs sent to stderr will be = written=20 > to 'log_directory' under the name 'log_filename', without having to = change=20 > syslog.conf (you just need to change postgresql.conf). >=20 > Additionaly, I added 'log_rotation_size =3D 0' to have on log file per = day. >=20 > Note that in that case, the log files won't be rotated, you'll need to = > check you don't store too many log file after a few months (as the = number=20 > of files will increase every day). setting 'log_destination' to 'stderr' could also log every sql statement = happen on my server? My mission is to activate 'log_statement' to 'all', so that i can log = all sql activity on my database. Regards, Joko [SYSTEM] PT. Indra Jaya Swastika Phone: +62 31 7481388 Ext 201 http://www.ijs.co.id -- 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 ------=_NextPart_000_014A_01C8E8D4.88AC6790 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
>> I added the following to=20 FreeBSD:
>>
>> /etc/newsyslog.conf:
>>=20 /var/log/postgresql         =            =20 600  7     *    @T00 =20 JC
make new file?
>> = /etc/syslog.conf:
>>=20 local0.*           = ;            =             &= nbsp;   =20 /var/log/postgresql
>>
>>=20 /usr/local/pgsql/data/postgresql.conf:
>> log_destination =3D=20 'syslog'
>> syslog_facility =3D 'LOCAL0'
>> = syslog_ident =3D=20 'postgres'
>> log_min_duration_statement =3D=20 100        # -1 is disabled, 0 logs=20 all
>> statements, in ms.
I already do this, but i can't find = my log=20 file
FYI, i just wanna to log every SQL=20 statement.

>> Remember to touch /var/log/postgresql before = restarting=20 syslogd (kill
>> -HUP syslog-pid). Chmod 0700 so only root can = read the=20 log-file.
>> Adjust log_min_duration_statement to your = needs.
i don't understand "to touch /var/log/postgresql"
> Hello,
>
> another possibility is to have logs = stored in=20 a file by just changing
> 'redirect_stderr' to 'on' and = 'log_destination'=20 to 'stderr'.
>
> This way, with the default config, all = logs sent=20 to stderr will be written
> to 'log_directory' under the name=20 'log_filename', without having to change
> syslog.conf (you just = need to=20 change postgresql.conf).
>
> Additionaly, I added=20 'log_rotation_size =3D 0' to have on log file per day.
>
> = Note that=20 in that case, the log files won't be rotated, you'll need to
> = check you=20 don't store too many log file after a few months (as the number
> = of=20 files will increase every day).
setting 'log_destination' to 'stderr' = could=20 also log every sql statement happen on my server?
 
My mission is to activate 'log_statement' to 'all', so that i can = log all=20 sql activity on my database.
 
Regards,
Joko [SYSTEM]
PT. Indra Jaya Swastika
Phone: +62 = 31=20 7481388  Ext 201
http://www.ijs.co.id

--
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 ------=_NextPart_000_014A_01C8E8D4.88AC6790--