News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

Simutrans log rotation + log location

Started by Ashley, January 03, 2011, 01:22:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ashley

Running Simutrans as a server process raises a few issues to do with maintenance. One is the question of log rotation. Is there a signal that can be sent to Simutrans (acting in server mode) that will tell it to reopen its log file? Typically log rotation is done such that you move the existing log file to another location then tell the process logging there to reopen the original log file, thus separating off that which has already been logged while ensuring that no logging is lost in the interim.

A related issue, is there a command line parameter to tell Simutrans where to log to (both stdout and stderr)? I know about the -log parameter to enable logging but is there another parameter which can specify a logging location?

These issues can be worked around via the shell but it'd be great to have a way to do this natively. If there isn't I'll move this to extension requests :)

(Extension request could be - when Simutrans is sent a SIGHUP signal instead of ending the process just have it re-read its configuration and/or reopen its log file). A custom signal could be used too so long as it is documented. The key thing is to have a way to do this which would not interrupt a network game in progress.

Update:

This can be worked around using a utility to redirect stderr and stdout of the Simutrans process to syslog, then filtering the messages out into their own log file(s). Gives timestamping too. Maybe a better extension request would be to make Simutrans syslog-aware...

Update #2:

Looks like some recent revision has changed the logging behavior so that the server will log to a file containing the port that it is running on. This is useful for a easy set up of multiple servers running on the same source files.
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.