Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Only the last log file of a server is shown in the dashboard

Discussion in 'Game Server Hosting' started by spikyworm5, Apr 4, 2023.

  1. spikyworm5

    spikyworm5

    Joined:
    Jul 13, 2020
    Posts:
    31
    Hello,

    I can only see the last log file of a server in the dashboard, What is wrong with my configuration?

    See the attached image for example of server logs:
    logs_dashboard.jpg

    My build configuration is:
    -nographics -batchMode -port $$port$$ -queryport $$query_port$$ -logFile $$log_dir$$/Engine.log
     
  2. ajdaniel_unity

    ajdaniel_unity

    Unity Technologies

    Joined:
    Jul 19, 2019
    Posts:
    22
    Can you elaborate with what you were hoping to see? I'm not fully sure I understand your expectation when you say you see "only the last log file".
     
  3. spikyworm5

    spikyworm5

    Joined:
    Jul 13, 2020
    Posts:
    31
    I expect to see log file per server session. The log file is being truncated on every session and I'm losing loggings of all previous sessions.
    I'd like to mention that I'm shutting down the server as the game session ends (Application.Quit), as suggested by the docs. Can it be reason? What is the best practice?
     
    Last edited: Apr 4, 2023
  4. airburst_studios

    airburst_studios

    Joined:
    Jan 7, 2023
    Posts:
    37
    I think for every new allocation the log file is being recreated.
    But I also would love to see a server log and an allocation log - so we have a better way to trace down problems. Because sometimes we run logic once and then we just clean up server states for allocation/deallocation.
     
  5. spikyworm5

    spikyworm5

    Joined:
    Jul 13, 2020
    Posts:
    31
    Right @airburst_studios. This is exactly the problem. It's impossible to trace down an issue if the server has already been allocated for another game session.
     
    Last edited: Apr 4, 2023
  6. danri

    danri

    Unity Technologies

    Joined:
    Jun 21, 2019
    Posts:
    27
    One thing you could do here is use the $$timestamp$$ variable in your build configuration, as documented here -https://docs.unity.com/game-server-hosting/en/manual/concepts/launch-parameters#Server

    This value will contain the timestamp at which the server started, so in your case the launch parameters would look something like:

    -nographics -batchMode -port $$port$$ -queryport $$query_port$$ -logFile $$log_dir$$/Engine-$$timestamp$$.log
     
    larah3d and airburst_studios like this.
  7. spikyworm5

    spikyworm5

    Joined:
    Jul 13, 2020
    Posts:
    31
    Excellent! Exactly what I needed. Is there a retention policy or limits for logging? Every instance can take ~100k so it might consume some storage after a while.
     
  8. escristianunity

    escristianunity

    Unity Technologies

    Joined:
    Jul 8, 2021
    Posts:
    8
  9. spikyworm5

    spikyworm5

    Joined:
    Jul 13, 2020
    Posts:
    31
    Hi. That sounds great. Currently it is very hard to navigate the logs. I registered