Downloading logs from GameLift container fleet

0

I've created a container fleet in GameLift servers, and set the log configuration to either S3 or CloudWatch. In either configuration, I can see the logs end up in the configured location (CloudWatch log stream or S3 bucket). However, when the logs arrive, they're named with an random-seeming ID that appears unrelated to the game session ID. The API contains a get-game-session-log command, but if I try to use it, I get the following error:

An error occurred (InvalidRequestException) when calling the GetGameSessionLogUrl operation: GetGameSessionLogUrl is not supported for container fleets.

Starting with a game session ID, I would like to be able to retrieve the logs that correspond to that specific session. Is this possible to do with a container fleet?

asked a month ago40 views
1 Answer
0

Yes, it is possible to retrieve logs for a specific game session in a container fleet, but the process differs from traditional GameLift fleets.

For container fleets, logs are automatically captured and stored either in Amazon CloudWatch Logs or Amazon S3, depending on your fleet's log configuration. However, the GetGameSessionLogUrl API operation is not supported for container fleets, which explains the error you encountered.

To retrieve logs for a specific game session in a container fleet:

  1. If using CloudWatch Logs:

    • Each container emits its own log stream within the specified CloudWatch log group.
    • The log streams are organized by fleet ID and container.
    • You can use CloudWatch features to search and analyze log data.
    • Look for log entries that correspond to your game session ID within these streams.
  2. If using Amazon S3:

    • Logs are stored in the specified S3 bucket in your fleet's home AWS region.
    • You can view, share, or download the content as needed.
    • You may need to search through the logs to find entries related to your specific game session ID.

While the logs may have random-seeming IDs as filenames, the content of the logs should contain information about the game session. You'll need to implement your own method to search and filter these logs based on the game session ID you're interested in.

To make this process easier, consider implementing a logging strategy in your game server code that clearly identifies each game session. For example, you could include the game session ID in your log messages, making it easier to filter and find relevant logs later.

Remember that you can modify a container fleet's logging configuration at any time, but this will require a fleet update deployment.

Sources
How containers work in Amazon GameLift Servers - Amazon GameLift Servers
Faster multiplayer hosting with containers on Amazon GameLift Servers | AWS for Games Blog

profile picture
answered a month ago
profile picture
EXPERT
reviewed a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions