question

Steve Lobdell avatar image
Steve Lobdell asked

My Server Logs are Incomplete?

After my server is terminated (My game ends itself, causing the server to shut down naturally), the log file doesn't really have anything in it. But it's not empty. This is what all my log files look like:

{"log":"sh: 1: xdg-user-dir: not found\n","stream":"stderr","time":"2023-02-06T15:17:41.444737153Z"}

{"log":"5.1.1-0+++UE5+Release-5.1 1008 0\n","stream":"stdout","time":"2023-02-06T15:48:50.414552723Z"}

{"log":"Disabling core dumps.\n","stream":"stdout","time":"2023-02-06T15:48:50.414585323Z"}

It looks like it's not finding some directory. Also, my docker file is almost completely copy-pasted from the docs. Here's what that looks like:

 FROM ubuntu:18.04
    
 # Unreal refuses to run as root user, so we must create a user to run as
 # Docker uses root by default
 RUN useradd --system ue
 USER ue
    
 EXPOSE 30000/udp
    
 WORKDIR /server
    
 COPY --chown=ue:ue ./LinuxServer /server
 USER root
 CMD chown -R ue.ue $PF_SERVER_LOG_DIRECTORY && su ue -c './VRPartyGameServer.sh port=30000 -EnableGSDK'

Any ideas? Thanks

Steve

Custom Game Servers
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. For more information, you can refer to Logging with the GSDK.

If you did, and it seems like 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 empty logs. If that’s the case, please check this thread answered by @Lewis Mohr to work around the issue.

We also suggest you debug your build locally with LocalMultiplayerAgent, you can refer to Locally debugging game servers and integration with PlayFab for more detail.

10 |1200

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

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.