Search Unity

Question Need help about how to get server logs

Discussion in 'Game Server Hosting' started by tosdik, Oct 5, 2022.

  1. tosdik

    tosdik

    Joined:
    Mar 5, 2018
    Posts:
    6
    I can not see the server logs on Unity dashboard and the doc says you need tho implement a query protocol. I searched on the internet, unity forums etc. but could not find anything about how to implement it.

    Anyone knows how to implement it?
     

    Attached Files:

  2. TomPUnity3D

    TomPUnity3D

    Unity Technologies

    Joined:
    Feb 24, 2022
    Posts:
    2
    Hi tosdik, Thanks for reaching out.

    Query protocol is actually not needed for logging, so the tooltip you screenshotted is a bit misleading, I will get that updated across our documentation

    Query protocol allows the Multiplay system to see gameserver information like number of players etc. Logging allows you to view any .log files that your gameserver creates.

    To get logging implemented correctly, you need to ensure your gameserver build is outputting whatever logging you need to a .log file. Once this is working, upload the build to Multiplay and specify the log file location using the build configuration launch parameters. Note, your gameserver will need to understand the launch parameter you are passing to it, for a Unity gameserver, this might look something like:

    -logFile $$log_dir$$


    $$log_dir$$ expands to be the file path that the gameserver is present in, so adjust this if your gameserver logs to a subfolder etc.

    The following documentation explains it a little bit more: https://docs.unity.com/game-server-hosting/guides/troubleshooting.html#Troubles

    Once your logging is setup correctly you can find it under:

    Servers > Server > Logs
     
  3. dixnri

    dixnri

    Joined:
    Mar 3, 2020
    Posts:
    7
    Hi,
    About server log, it should show the log from Debug.Log right? Why my logfile didn't show any text from Debug.Log?
     
  4. Alexis_UGS

    Alexis_UGS

    Unity Technologies

    Joined:
    Mar 2, 2022
    Posts:
    30
    Hi,

    Do you mind sharing here which engine and the launch parameters your are using?
     
  5. dixnri

    dixnri

    Joined:
    Mar 3, 2020
    Posts:
    7
    Hi,

    Never mind, it was my fault.
    The reason is because the game never starts, OnAllocate event is not called.
    I got errors from MultiplayService.Instance.SubscribeToServerEventsAsync, I will ask about this in another thread, please respond my thread too, thanks.
     
  6. Alexis_UGS

    Alexis_UGS

    Unity Technologies

    Joined:
    Mar 2, 2022
    Posts:
    30
    No worries, thanks for letting us know!
     
  7. escristianunity

    escristianunity

    Unity Technologies

    Joined:
    Jul 8, 2021
    Posts:
    8