From: Rudolph v. G. <rv...@pa...> - 2004-05-13 10:17:17
Attachments:
smime.p7s
|
Hi all, I noticed that yaws seem to rotate the log files (.access file) whenever it grows beyond a specific size, deleting the previous .old and then naming the current file .old. I don't want this behaviour, as it destroys a lot of data. Is there a way to configure yaws not to do this? I.e. I want a continuous log, without rotation. We'll handle rotation with a standard unix solution. We're running yaws 1.41 Any ideas will be greatly appreciated! Rudolph van Graan Telecommunications Specialist Pattern Matched Technologies E-Mail: rv...@pa... Mobile: +27 82 905 7496 Fax: +27 12 667 5342 Web: www.patternmatched.com |
From: Carsten S. <ca...@co...> - 2004-05-13 12:08:37
|
Hi Rudolph! > I noticed that yaws seem to rotate the log files (.access file)=20 > whenever it grows beyond a specific size, deleting the previous .old=20 > and then naming the current file .old. >=20 > I don't want this behaviour, as it destroys a lot of data. Is there a=20 > way to configure yaws not to do this? I'm afraid, not. The size at which a new log file is started is one of the constants that are hard-coded and should not be. Another one that comes to my mind is the session timeout of 30mins. Your constant is -define(WRAP_LOG_SIZE, 400000). in yaws_log.erl and you could set it to a very large value there. Alternative, I expect that a patch to make it configurable would be welcome :-) Greetings, Carsten --=20 Carsten Schultz (2:38, 33:47), FB Mathematik, FU Berlin http://carsten.codimi.de/ PGP/GPG key on the pgp.net key servers,=20 fingerprint on my home page. |
From: Hal S. <ha...@va...> - 2004-05-13 13:31:34
|
Carsten Schultz <ca...@co...> writes: > -define(WRAP_LOG_SIZE, 400000). > > in yaws_log.erl and you could set it to a very large value there. > Alternative, I expect that a patch to make it configurable would be > welcome :-) A common practice on Unixes is for daemons to close and reopen their logfiles on receipt of a signal such as HUP or USR1. There are advantages to this practice. 1. You don't have every app reimplementing log rotation in a slightly different way, with different assumptions about what the default policy should be, etc. 2. A single program can take care of rotating logs for all configured services. On the BSDs it's called newsyslog and is part of the OS. You can choose per service how big or how old a logfile may get, how many old files to keep, and so on. There is an autoconf variant for other OSes. 3. Smart "tail" programs can do tail -f on such logs and will not be confused when the service rotates files. This is done by watching for a drop in the size of the logfile and reopening when it is detected. While Erlang doesn't play nicely with Unix signals http://www.erlang.org/ml-archive/erlang-questions/200108/msg00089.html allowing log close and reopen on receipt of some external event might still be a good idea. I don't think this thread is really about signals, but BTW a shell program could manufacture the needed event on receipt of a signal until a nice signal option is added to erlang along the lines of http://www.erlang.org/ml-archive/erlang-questions/200110/msg00056.html |