Board index » database » log file rotate

log file rotate

2004-08-08 10:27:51 AM
Tom, you didn't like Andreas' idea of allowing the user to rotate the
log files on demand. Isn't that standard functionality for any logging
program in case you want to manually start a new log file? Is there no
way to do this simply? Is this a TODO?
--
Bruce Momjian | candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match
-
 

Re:log file rotate

Bruce Momjian <pgman@candle.pha.pa.us>writes:
Quote
Tom, you didn't like Andreas' idea of allowing the user to rotate the
log files on demand.
Give me a use case that requires that, and is sufficiently interesting
to justify even a marginal decrease in the reliability of the log
process.
Frankly, I do not believe that database users should have anything to do
with the log rotation process. Do we have a TODO for allowing users to
force switching to a new WAL file segment?
Quote
Is this a TODO?
IMHO, no.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
-

Re:log file rotate

Tom Lane wrote:
Quote
Bruce Momjian <pgman@candle.pha.pa.us>writes:
Quote
Tom, you didn't like Andreas' idea of allowing the user to rotate the
log files on demand.

Give me a use case that requires that, and is sufficiently interesting
to justify even a marginal decrease in the reliability of the log
process.

Frankly, I do not believe that database users should have anything to do
with the log rotation process. Do we have a TODO for allowing users to
force switching to a new WAL file segment?
I thought rotatelogs supported it so we should in cases where someone
wanted to make a new log file to delete an unusually large one, like a 1
gig log file caused by some runaway process. However, I see rotatelogs
doesn't have that capability so I guess we don't need it either.
--
Bruce Momjian | candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
-

Re:log file rotate

Bruce Momjian <pgman@candle.pha.pa.us>writes:
Quote
I thought rotatelogs supported it so we should in cases where someone
wanted to make a new log file to delete an unusually large one, like a 1
gig log file caused by some runaway process.
Hm? We have a rotate-on-size parameter, so that's not going to happen.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
-

Re:log file rotate

Tom Lane wrote:
Quote
Bruce Momjian <pgman@candle.pha.pa.us>writes:
Quote
I thought rotatelogs supported it so we should in cases where someone
wanted to make a new log file to delete an unusually large one, like a 1
gig log file caused by some runaway process.

Hm? We have a rotate-on-size parameter, so that's not going to happen.
Ah, OK.
--
Bruce Momjian | candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
-

Re:log file rotate

Tom Lane wrote:
Quote
Bruce Momjian <pgman@candle.pha.pa.us>writes:

Quote
Tom, you didn't like Andreas' idea of allowing the user to rotate the
log files on demand.


Give me a use case that requires that, and is sufficiently interesting
to justify even a marginal decrease in the reliability of the log
process.
- Debugging some stuff, a distinct period of work, I'd like to start
with a fresh serverlog.
- When doing a backup, I'd like to continue with a fresh serverlog so I
can see what was happening since that point in time.
MSSQL calls this sp_cycle_errorlog.
I can't see even a marginal decrease of reliability, since the logger
already accepts SIGHUP, and will reevaluate postgresql.conf to set the
rotation_requested flag accordingly; I'm just asking for setting the
flag directly.
Regards,
Andreas
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
-

Re:log file rotate

Tom Lane wrote:
Quote

Give me a use case that requires that, and is sufficiently interesting
to justify even a marginal decrease in the reliability of the log
process.

Frankly, I do not believe that database users should have anything to do
with the log rotation process.
The (super)user will sometimes purge old files, so he *does* have to do
something with the rotation process' output. It's up to him what he
regards as old, maybe everything before 'now'.
YAUC (yet another use case): rotating every day at 3 am.
Regards,
Andreas
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
-