The Toolkit for Online Communities
16686 Community Members, 1 member online, 2223 visitors today
Log In Register
OpenACS Home : Forums : OpenACS Q&A : rolling the server log -- AOLServer 3.2-x?

Forum OpenACS Q&A: rolling the server log -- AOLServer 3.2-x?

Icon of envelope Request notifications

Although the access logs (in /../aolserver/servers/myserver/modules/nslog/) rotate correctly, the server log (/../aolserver/log/server.log) does not. This is despite setting ns_param LogRoll to 'on' in the ns_section "ns/parameters" in the /../aolserver/nsd.tcl config file. I'm using AOLServer 3.2-4 on a Debian woody box.

There was a thread about this a long time ago (here) but no solution was posted (and Rob can't recall what he did according to email he just sent me).

Are those of you with properly rolling server log using logrotate or some other system log utility to do this, or is there some other inapparent configuration setting in the nsd.tcl file that I need to adjust?

Many thanks for any help!

Posted by Arjun Sanyal on
Try out the logroll.tcl script I just uploaded to /new-file-storage
Posted by David Walker on
here's the appropriate section of my nsd.tcl on one of my boxes that rolls the server logs. Let me know if you figure out which settings you need to roll the server logs.

ns_section "ns/parameters"
        ns_param   home         $homedir
        ns_param   debug        false
        ns_param   MailHost     mail.vorteon.com
        ns_param   ServerLog    /var/log/nsd/server-${server}.log
        ns_param   LogRoll      on
        ns_param   LogMaxBackup 5
        ns_param   KeepAliveTimeout 0
        ns_param   MaxKeepAlive     0
        ns_param   PidFile      /var/run/nsd/nspid.${server}
Posted by Petru Paler on

I just use daemontools and multilog to roll the logs (so I'm starting nsd with -f and piping the output through multilog). This method has the added advantage of rolling based on file size.

Posted by Jonathan Marsden on

It sounds as though you may have left out the LogMaxBackup setting under ns/parameters?  I'm pretty sure you need that *and* LogRoll on for the log rotation to occur (though I didn't read the AOLserver source to confirm this!).

The nsd.tcl in my current AOLserver RPMs seems to "just work" in this regard, under AOLserver 3.2-4+ad12 or AOLserver 3.3.1+ad13; I can upload it to new-file-storage separately if that would be helpful.

Posted by Stan Kaufman on
Thx for the various suggestions. It appears that some of you have AOLServer roll server.log itself, and others of you use a system utility. TMTOWTDI I guess, though is there some reason to prefer the former over the latter?

Anyway, I set LogMaxBackup in nsd.tcl (and restarted AOLServer of course) but in 48hrs now no rolling of server.log has occured. There must be something else to set somewhere? Or perhaps the problem is that I'm using AOLServer 3.2-4 packaged by Debian and not an 3.2-adx version. Perhaps the log rolling stuff was added by the OpenNSD effort?

Perhaps I should move this thread over to the OpenNSD site...

Posted by Jonathan Ellis on
from the config file guide, it seems that the only way to roll the warning/error logfile is to send SIGHUP. Only these parameters/ options affect the warning logfile; modules/nslog is for the access logfile. [Although the docs could be wrong; for instance, nsd 3.3 aD 13 is ignoring my LogMaxBackup parameter.] But SIGHUP definitely rolls it.

(formatting is screwed up. The fields are optionName, default, description.)

  • LogMaxBackup 10 The maximum number of server log backup files.
  • LogRoll on Boolean value. If set to on, the server log file will be rolled on a SIGHUP.
  • ServerLog /log/server.log under the AOLserver home directory The file to contain any notices, warnings, or errors generated by AOLserver if AOLserver is run as a background process. If AOLserver is run in the foreground, messages are written to standard output, and this parameter is ignored.

Posted by David Walker on
That does spark my memory.  I do indeed have a cron job that sends
SIGHUP once daily.
Posted by Stan Kaufman on
The logroll.tcl script that Arjun uploaded works great. Thanks Argun!