Save server log

SupaFredSupaFred Join Date: 2013-03-03 Member: 183652Members, NS2 Playtester, Squad Five Blue, NS2 Map Tester, Reinforced - Supporter, Reinforced - Silver, Reinforced - Shadow, WC 2013 - Silver
I have always found it strange that NS2 server overwrites the server log on startup. How about making it continue use the same file? Or save the old log file under a different name?

Comments

  • GhoulofGSG9GhoulofGSG9 Join Date: 2013-03-31 Member: 184566Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Reinforced - Supporter, WC 2013 - Supporter, Pistachionauts
    edited July 2014
    SupaFred wrote: »
    I have always found it strange that NS2 server overwrites the server log on startup. How about making it continue use the same file? Or save the old log file under a different name?

    What exactly would be the usage of storing old logs? That the log file doesn't get stored is quiet a normal behavier to avoid that the logs take to much hdd space at a server.
  • SupaFredSupaFred Join Date: 2013-03-03 Member: 183652Members, NS2 Playtester, Squad Five Blue, NS2 Map Tester, Reinforced - Supporter, Reinforced - Silver, Reinforced - Shadow, WC 2013 - Silver
    To see the cause of the crash? Sometimes I'm asked for log files after a server crash. I have a script that saves the old log files but it's not always working.
  • ATFATF Join Date: 2014-05-09 Member: 195944Members
    We're using a batch script to save the old file and it's not missed one so far. It's the same one that restarts the server after a crash, but it's working differently from the approach i've seen on this forum.

    What it's doing differently is that it runs completely independant of the ns2ds process, but it will manage it if you run it.

    Still, the way vanilla currently works is no good, there's no short term history (the entire purpose of a log). You're forced to save it somewhere else because it gets overwritten immediately.

    This is the relevant part of what we run before the script starts/restarts ns2ds:
    FOR /F "tokens=1,2,3 delims=." %%x IN ("%date%") DO SET LogDate=%%z%%y%%x
    FOR /F "tokens=1,2 delims=:," %%v IN ("%time%") DO SET LogTime=%%v%%w
    COPY /Y "%appdata%\Natural Selection 2\log-Server.txt" "D:\NS2DS-log-archive\%Logdate%-%LogTime%.txt" >NUL
    

    Too bad the log very rarely shows anything relevant for crashes.
Sign In or Register to comment.