question

Dave Chapman avatar image
Dave Chapman asked

Unreal GSDK log files are not being archived?

If I run my server locally using LocalMultiplayerAgent, it creates two log files in [OutputDir]\PlayFabVmAgentOutput[DateAndTime]\GameLogs[GUID] which are GSDK_output_[Ticks].txt PF_ConsoleLogs.txt

The PF_ConsoleLogs file appears to capture all stdout logging. The GSDK_output file captures all of Unreal's logging.

If I run the server online, PlayFab is only zipping and archiving the PF_ConsoleLogs.txt file, the GSDK_output file is always missing.

I was going to write additional files to the logs folder, but if the files written by the SDK don't get archived then I guess mine won't either...?

unreal
10 |1200

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

1 Answer

·
Neils Shi avatar image
Neils Shi answered

Did you implement Logging with the GSDK? There are two ways to add some logs from your game server:

1.Use the GSDK's Log method - It will add your own log lines to the GSDK log file.

2.Write your own log file in the appropriate log directory that the PlayFab VM agent will zip up and upload.

Please make sure your game server is using one of them. And if you did, since you are using Unreal, please note that UE4 doesn’t support changing the log location at runtime, hence it might the case that you can’t get Unreal to write the log file to the right location, which leads to the empty logs. If that’s the case, you can check this thread answered by @Lewis Mohr to work around the issue.

4 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.

Dave Chapman avatar image Dave Chapman commented ·

It's using your GSDK, so option (1).

The GSDK code here:

https://github.com/PlayFab/gsdk/blob/main/UnrealPlugin/Source/PlayFabGSDK/Private/GSDKInternal.cpp

In function FGSDKInternal::StartLog() captures Unreal's logging and writes it out to GSDK_output_xxxx.txt.

That file is not being zipped and archived when the server is hosted online by PlayFab.

The log location has not been changed, it's the default log file created by GSDK in its default location.

0 Likes 0 ·
Dave Chapman avatar image Dave Chapman commented ·

Looks like it could be the same as question 143555, we have to write a script to 'chown' the log file directory because Unreal runs as a different user instead of root. It's not that the files weren't being archived, they were failing to be created.

0 Likes 0 ·
Dimitris Gkanatsios avatar image Dimitris Gkanatsios Dave Chapman commented ·

we have a script to modify the ownership of the logs directory, doesn't it work for you? https://github.com/PlayFab/gsdk/blob/main/UnrealPlugin/ThirdPersonMPCloudDeploy.md#the-linux-dockerfile

0 Likes 0 ·
Dave Chapman avatar image Dave Chapman Dimitris Gkanatsios commented ·

Yes, that does work, thank you. Somehow it had been missed when we first created our upload script for this project.

0 Likes 0 ·

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.