Обсуждение: Question regarding log files in postgresql

Поиск
Список
Период
Сортировка

Question regarding log files in postgresql

От
"lucas.gary@gmail.com"
Дата:


I've rolled postgres to 'production', so box is in prod, but the applications aren't active yet.

When I rolled the new box I'm seeing 2 log files:

postgresql-yyyy-MM-dd_hhmmss.log 
AND
postgresql-9.3-main.log

The 'main' log doesn't appear to be used, however the time stamped file is.

Does this make sense?  Is it normal?  

My logrotate entry makes some assumptions that may be incorrect now.

Gary

Re: Question regarding log files in postgresql

От
David G Johnston
Дата:
lucas.gary@gmail.com wrote
> I've rolled postgres to 'production', so box is in prod, but the
> applications aren't active yet.
>
> When I rolled the new box I'm seeing 2 log files:
>
> postgresql-yyyy-MM-dd_hhmmss.log
> AND
> postgresql-9.3-main.log
>
> The 'main' log doesn't appear to be used, however the time stamped file
> is.
>
> Does this make sense?  Is it normal?
>
> My logrotate entry makes some assumptions that may be incorrect now.
>
> Gary

Likely the main log is the one that is used before any log file settings in
postgres.conf are read in and applied.  Then, once the date tagged format in
postgres.conf is processed that file is used and the main file no longer is
needed.

David J.





--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Question-regarding-log-files-in-postgresql-tp5812284p5812292.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


Re: Question regarding log files in postgresql

От
Adrian Klaver
Дата:
On 07/21/2014 02:21 PM, lucas.gary@gmail.com wrote:
>
>
> I've rolled postgres to 'production', so box is in prod, but the
> applications aren't active yet.
>
> When I rolled the new box I'm seeing 2 log files:
>
> postgresql-yyyy-MM-dd_hhmmss.log
> AND
> postgresql-9.3-main.log

Are they both in the same location?

I'm going to say you used a Debian/Ubuntu package correct?

>
> The 'main' log doesn't appear to be used, however the time stamped file is.

That is the log file set up by the packaging system.

>
> Does this make sense?  Is it normal?

My guess is either:

1) You are running a Debian style package and went into postgresql.conf
and changed the log settings so you are not using the package logging.

or

2) You have/had a Debian package installed and you did a source(or other
install) and you have two logs as a result.


I think it would be a good idea to investigate further for no other
reason than ensure that you really do not have competing systems at
work. Might save you some headaches down the road.

>
> My logrotate entry makes some assumptions that may be incorrect now.

Another reason to verify what is going on.

>
> Gary


--
Adrian Klaver
adrian.klaver@aklaver.com


Re: Question regarding log files in postgresql

От
"lucas.gary@gmail.com"
Дата:
Hi again, it's deployed to a Ubuntu image, but we're using chef to configure the box.  I know for a fact that chef starts and stops Postgresql multiple times during the install so I'm pretty sure the MAIN log is from the initial start, thank you too David G for pointing that out.  

My next question is how is postgres picking the filename, but after doing a little investigation that mystery is cleared up too.  

Thank you both for responding.  Now I just have to modify our logrotate script + blow away the accumulated cruft.

Gary


On Mon, Jul 21, 2014 at 5:34 PM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 07/21/2014 02:21 PM, lucas.gary@gmail.com wrote:


I've rolled postgres to 'production', so box is in prod, but the
applications aren't active yet.

When I rolled the new box I'm seeing 2 log files:

postgresql-yyyy-MM-dd_hhmmss.log
AND
postgresql-9.3-main.log

Are they both in the same location?

I'm going to say you used a Debian/Ubuntu package correct?



The 'main' log doesn't appear to be used, however the time stamped file is.

That is the log file set up by the packaging system.



Does this make sense?  Is it normal?

My guess is either:

1) You are running a Debian style package and went into postgresql.conf and changed the log settings so you are not using the package logging.

or

2) You have/had a Debian package installed and you did a source(or other install) and you have two logs as a result.


I think it would be a good idea to investigate further for no other reason than ensure that you really do not have competing systems at work. Might save you some headaches down the road.



My logrotate entry makes some assumptions that may be incorrect now.

Another reason to verify what is going on.


Gary


--
Adrian Klaver
adrian.klaver@aklaver.com