Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 99CC59FBBB3 for ; Tue, 27 Feb 2007 20:02:31 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 95335-03 for ; Tue, 27 Feb 2007 20:02:25 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from cooma-1.andyshellam.eu (cooma-1.andyshellam.eu [82.165.38.62]) by postgresql.org (Postfix) with ESMTP id A62AA9FBBAD for ; Tue, 27 Feb 2007 20:02:24 -0400 (AST) Received: from user-3e884882.telcl18.dsl.pol.co.uk ([62.136.72.130]:1405 helo=[10.100.9.2]) by cooma-1.andyshellam.eu with esmtpa (Exim 4.66) (envelope-from ) id 1HMCJO-0005ma-3q; Wed, 28 Feb 2007 00:04:50 +0000 Message-ID: <45E4C676.7050501@mailnetwork.co.uk> Date: Wed, 28 Feb 2007 00:01:58 +0000 From: "Andy Shellam (Mailing Lists)" User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: jing han , PostgreSQL Admin Mailing List Subject: Re: [INTERFACES] where postgres 8.1.8 log messages go References: <726959.56194.qm@web53502.mail.yahoo.com> In-Reply-To: <726959.56194.qm@web53502.mail.yahoo.com> Content-Type: multipart/alternative; boundary="------------010601040802090503060804" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.434 tagged_above=0 required=5 tests=AWL, BAYES_50, HTML_30_40, HTML_MESSAGE, SPF_PASS X-Spam-Level: X-Archive-Number: 200702/343 X-Sequence-Number: 24808 This is a multi-part message in MIME format. --------------010601040802090503060804 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Firstly, NEVER point log_directory to your cluster data directory - always keep it separate. (Personally I put all log files under /var/log/.) Secondly, I've copied this to pgsql-admin, not pgsql-interfaces as it's more of an admin issue than programmability. You need to make sure that the PostgreSQL user can write to log_directory. (Ideally log_directory should be owned by postgres, which works well if like me you use /var/log/ as a different application won't be able to write to postgres's log folder.) Also note, you need redirect_stderr set to on to capture the output into log files, otherwise it'll all go on the console. And while debugging, don't turn on silent mode! Wait till you've got it working then switch silent mode on. Please post the entire logging section of your postgresql.conf if you have further difficulties. Now it's on the right list, more people can chip in and help - I'd advise joining pgsql-admin if you haven't already. Andy. jing han wrote: > Hi Andy, > > Thank you so much for your help. I think what you said are perfectly > right. But I still encountered strange problem. > > I added log_directory='/var/nm2' > log_filename='pgsql.log' > > /var/nm2 is the directory for database files in my system, the > directory ownership is postgres:postgres, so I think no permission > problem if later postgres server log message into the file under this > directory) > > And for better debugging, I use > log_min_error_statement = info > > After start postmaster, I looked at directory '/var/nm2', didn't find > pgsql.log file, then I did some database update action, I still > couldn't see pgsql.log generated. > > I also tried log_directory=/var/log/pgsql the same thing happen. > > what else I need to do to make things right? > > > jing > > ----- Original Message ---- > From: Andy Shellam (Mailing Lists) > To: jing han ; pgsql-interfaces@postgresql.org > Sent: Tuesday, February 27, 2007 10:57:09 AM > Subject: Re: [INTERFACES] where postgres 8.1.8 log messages go > > Don't forget to copy back to the list - Reply To All is your friend ;) > > This is my configuration: > > log_directory = '/var/log/endeavour/pgsql' # Directory > where log files are written > > Note the single quotes, not double - this could be your problem. > > Also note that /var/log/messages is a file, not a directory. > PostgreSQL will write it's own log files.. > If you want to use a specific log file, use log_filename in > conjunction with log_directory - but note that syslog uses > /var/log/messages so don't use that or it'll get syslog confused. > You can log to syslog as well, if that's what you want to do. Read > that manual page some more. > > I would also not put the log files in /var/log - at least make a > subdirectory like /var/log/pgsql. > I've known built-in Linux rotate and compress scripts to play havoc > with PostgreSQL by rotating and compressing it's logs while it's > trying to use them, when they're in /var/log. > > Andy. > > jing han wrote: >> Hi Andy, >> >> Thanks for the information. I tried to add >> >> log_destination = "/var/log/messages" >> >> into postgresql..conf, then I started database server, I found that db server throwed the following error message: >> >> FATAL: syntax error in file "/var/nm2/postgresql.conf" line 130, near token """ >> >> Can you tell me the syntax for this? >> >> The document said that " This option can be set at server start or in the postgresql.conf configuration file.", If set at server start, >> what is the option for this pramater? (for example: -D is for the database file directory) >> >> Thank you for your help. >> >> >> jing >> ---- Original Message ---- >> From: Andy Shellam (Mailing Lists) >> To: jing han >> Cc: pgsql-interfaces@postgresql.org >> Sent: Tuesday, February 27, 2007 9:32:56 AM >> Subject: Re: [INTERFACES] where postgres 8.1.8 log messages go >> >> Wherever you want them to. >> In your postgresql.conf file, review the "logging" section. >> >> The following will help you: >> >> http://www.postgresql.org/docs/8.1/static/runtime-config-logging.html >> >> Andy. >> >> jing han wrote: >> >>> Hello, >>> >>> I have a question about postgres log messages. postgres 7.2.3 log messages go to /var/log/messages file, postgres 8.1.8 log messages do not go to /var/log/messages, so where they go? >>> >>> Any feedback will be appreciated.. >>> >>> >>> jing >>> >>> >>> >>> >>> >>> ____________________________________________________________________________________ >>> Want to start your own business? >>> Learn how on Yahoo! Small Business. >>> http://smallbusiness.yahoo.com/r-index >>> >>> ---------------------------(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 2: Don't 'kill -9' the postmaster >> >> >> >> >> >> >> ____________________________________________________________________________________ >> Any questions? Get answers on any topic at www.Answers.yahoo.com. Try it now. >> >> >> >> >> > --------------010601040802090503060804 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Firstly, NEVER point log_directory to your cluster data directory - always keep it separate.  (Personally I put all log files under /var/log/<application_name>.)
Secondly, I've copied this to pgsql-admin, not pgsql-interfaces as it's more of an admin issue than programmability.

You need to make sure that the PostgreSQL user can write to log_directory.  (Ideally log_directory should be owned by postgres, which works well if like me you use /var/log/<app name> as a different application won't be able to write to postgres's log folder.)

Also note, you need redirect_stderr set to on to capture the output into log files, otherwise it'll all go on the console.
And while debugging, don't turn on silent mode!  Wait till you've got it working then switch silent mode on.

Please post the entire logging section of your postgresql.conf if you have further difficulties.  Now it's on the right list, more people can chip in and help - I'd advise joining pgsql-admin if you haven't already.

Andy.

jing han wrote:
Hi Andy,

Thank you so much for your help.  I think what you said are perfectly right. But I still encountered strange problem.

I added log_directory='/var/nm2' 
            log_filename='pgsql.log'

/var/nm2 is the directory for database files in my system, the directory ownership is postgres:postgres, so I think no permission problem if later postgres server log message into the file under this directory)
           
And for better debugging, I use
log_min_error_statement = info

After start postmaster, I looked at directory '/var/nm2', didn't find pgsql.log file, then I did some database update action, I still couldn't see pgsql.log generated.

I also tried log_directory=/var/log/pgsql   the same thing happen.

what else I need to do to make things right?


jing

----- Original Message ----
From: Andy Shellam (Mailing Lists) <andy.shellam-lists@mailnetwork.co.uk>
To: jing han <jing_han_66@yahoo.com>; pgsql-interfaces@postgresql.org
Sent: Tuesday, February 27, 2007 10:57:09 AM
Subject: Re: [INTERFACES] where postgres 8.1.8 log messages go

Don't forget to copy back to the list - Reply To All is your friend ;)

This is my configuration:

log_directory = '/var/log/endeavour/pgsql'              # Directory where log files are written

Note the single quotes, not double - this could be your problem.

Also note that /var/log/messages is a file, not a directory.  PostgreSQL will write it's own log files..
If you want to use a specific log file, use log_filename in conjunction with log_directory - but note that syslog uses /var/log/messages so don't use that or it'll get syslog confused.
You can log to syslog as well, if that's what you want to do.  Read that manual page some more.

I would also not put the log files in /var/log - at least make a subdirectory like /var/log/pgsql.
I've known built-in Linux rotate and compress scripts to play havoc with PostgreSQL by rotating and compressing it's logs while it's trying to use them, when they're in /var/log.

Andy.

jing han wrote:
Hi Andy,

Thanks for the  information. I tried to add

log_destination = "/var/log/messages"

into postgresql..conf, then I started database server, I found that db server throwed the following error message:

FATAL:  syntax error in file "/var/nm2/postgresql.conf" line 130, near token """

Can you tell me the syntax for this?

The document said that " This option can be set at server start or in the          postgresql.conf configuration file.", If set at server start,
what is the option for this pramater? (for example: -D  is for the database file directory)

Thank you for your help.


jing
---- Original Message ----
From: Andy Shellam (Mailing Lists) <andy.shellam-lists@mailnetwork.co.uk>
To: jing han <jing_han_66@yahoo.com>
Cc: pgsql-interfaces@postgresql.org
Sent: Tuesday, February 27, 2007 9:32:56 AM
Subject: Re: [INTERFACES] where postgres 8.1.8 log messages go

Wherever you want them to.
In your postgresql.conf file, review the "logging" section.

The following will help you:

http://www.postgresql.org/docs/8.1/static/runtime-config-logging.html

Andy.

jing han wrote:
  
Hello,

I have a question about postgres log messages. postgres 7.2.3 log messages go to /var/log/messages file, postgres 8.1.8 log messages do not go to /var/log/messages, so where they go?

Any feedback will be appreciated..


jing




 
____________________________________________________________________________________
Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index

---------------------------(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 2: Don't 'kill -9' the postmaster





 
____________________________________________________________________________________
Any questions? Get answers on any topic at www.Answers.yahoo.com.  Try it now.




  


--------------010601040802090503060804--