question

Ruben Pascual Blanco avatar image
Ruben Pascual Blanco asked

GameserverSDK.LogMessage("") and GameserverSDK.GetLogsDirectory() In Unity: Can't find these methods anywhere

I spent days looking where are these methods needed to debug remote gameservers with the GDSK but the Unity version doesn't seem to include any of this anywhere.

Any idea on how to perform the direct log and get the log folder so I can redirect Unity default logs to the terminated server log zip files?

multiplayer
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Rick Chen avatar image Rick Chen ♦ commented ·

What do you mean by performing the direct log and redirecting Unity default logs to the terminated server log zip files? You can checkout this document Connect directly to debug game servers - PlayFab | Microsoft Docs to debug your game servers remotely.

0 Likes 0 ·
Ruben Pascual Blanco avatar image Ruben Pascual Blanco Rick Chen ♦ commented ·

I can't connect directly because the system terminates the servers

0 Likes 0 ·
Dimitris-Ilias Gkanatsios avatar image
Dimitris-Ilias Gkanatsios answered

try this method to get the configuration, including the log folder gsdk/PlayFabMultiplayerAgentAPI.cs at main PlayFab/gsdk (github.com)

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ruben Pascual Blanco avatar image Ruben Pascual Blanco commented ·

That method only returns ipv4 and ports information. Is there soemthing i'm missing?

0 Likes 0 ·
Dimitris-Ilias Gkanatsios avatar image Dimitris-Ilias Gkanatsios Ruben Pascual Blanco commented ·

oh, I'm so sorry, wrong copy :) check the GetConfigSettings gsdk/PlayFabMultiplayerAgentAPI.cs at main PlayFab/gsdk (github.com)

1 Like 1 ·
Ruben Pascual Blanco avatar image Ruben Pascual Blanco Dimitris-Ilias Gkanatsios commented ·

I got the log directory (it shows "data/GameLogs") but cannot get localmuttiplayeragent to create log files outside the machine.

its getting very very frustrating, 3 montsh of not being able to run builds (always unhealthy) while localagent works fine, cannot connect directly to see the logs because servers are terminated and removed and cannot debug anything because I cannot log anything outside of containers. I'm getting very tired of this.

0 Likes 0 ·
Dimitris-Ilias Gkanatsios avatar image
Dimitris-Ilias Gkanatsios answered

Also you can get it via environment variables Basics of a PlayFab game server - PlayFab | Microsoft Docs

5 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ruben Pascual Blanco avatar image Ruben Pascual Blanco commented ·

Is there any way to add PF_SERVER_LOG_DIRECTORY as a command line argument for -logFile?

0 Likes 0 ·
Ruben Pascual Blanco avatar image Ruben Pascual Blanco commented ·

UPDATE: I managed to connect directly to the container without it being terminated isntantly, but cannot seem to get unity to create a standard log file to check where the server gets stuck. I can explore all the file system and check the server process but cannot find any txt logs created

I tried -logFile command but it doesn't create any directory inside the container.

0 Likes 0 ·
Dimitris-Ilias Gkanatsios avatar image Dimitris-Ilias Gkanatsios Ruben Pascual Blanco commented ·

I *think* that -logFile will send the logs to standard output where there will be captured by our VmAgent when the game server will terminate.

0 Likes 0 ·
Ruben Pascual Blanco avatar image Ruben Pascual Blanco Dimitris-Ilias Gkanatsios commented ·

Just "-logFIle" without any extra arguments of where it goes? Does it have to include the file name like "-logFile log.txt"?

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.