question

Matt avatar image
Matt asked

Legacy Game Server Log Files

Hi folks,

I'm finding myself more and more in need of some debugging information, yet I can't get the log files to work at all with my legacy game server (TitleId: AC50).

I posted a new server build and added, to the command-line arguments, "-logFile=<log_file_path>". Within my code, same as the example on GitHub, I have tons of Debug.Log calls with various information. I know at least some of them have been hit because I was able to get a couple of players matched. The problem is that after I terminate the server instance, the Logs link in Archived Games sends me to a 404 error.

I need these logs to determine what's actually happening within my server code. Any help would be seriously appreciated.

Thanks!

-Matt

10 |1200

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

Matt avatar image
Matt answered

I finally got logs to show up!

The short answer:

I needed to remove the equals sign (=) from my -logFile command-line entry. I copied what every other command-line argument did and added an equal sign, but for this it needs to be specifically:

-logFile <log_file_path>

As of right now, I still cannot connect to that sample PlayFab server. The game mode error continues to pop up. Since this system is legacy/deprecated and my personal server is able to produce logs now, I'd consider this resolved and no longer an issue worth investigating.

Thank you so much, I'm not surprised it was such a simple problem. I was thrown off because I always get errors posting builds or making changes in the Game Manager using the legacy menu.

10 |1200

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

Citrus Yan avatar image
Citrus Yan answered

May I know which example are you referring to (the link), and the detailed code snippet you're using that logs the info? (Please remove any sensitive info).

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

Matt avatar image Matt commented ·

Yes, thank you. The project I was referencing is here: https://github.com/PlayFab/PlayFabGameServer

They simply use Debug.Log in various places. I tried, at one point, to Inject the Logger and use a Dispatch call, but that didn't seem to work either.

An example of my call is pretty straight forward:

void OnConnect( NetworkMessage netMsg )
{
	Debug.Log( string.Format( "A new connection was made: <color=#448800>ID {0}</color>.", netMsg.conn.connectionId ) );

	ArenaPlayer player = new ArenaPlayer() { State = PlayerState.Connected, Connection = netMsg.conn };
	m_PlayersBoarding.Add( player );

	StartCoroutine( CheckAuthentication( player ) );
}

I notice I have it formatted with rich text from when I was testing locally. That shouldn't cause any problems though.

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Matt commented ·

Did you try hosting the server sample https://github.com/PlayFab/PlayFabGameServer on PlayFab and have the client sample connect to it? I tried from my side and it worked fine, players can connect and logs are archived.

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Citrus Yan commented ·

And, what's your Unity version?

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.