Home

Awesome

Centralized logging for Unity game clients

Stream debug logs from your game clients to Google Cloud Platform. Browse and search your game client logs in the Stackdriver Logging web UI. See common errors with callstacks in the Stackdriver Error Reporting web UI.

This is primarily intended for use during internal development. If you use this in production, be aware that streaming all logs from all game clients can be costly.

This consists of three parts:

Setup

Filtering and browsing results

Visit the Stackdriver Logging web UI. Find a single line of text from the session that you are interested in. Expand the entry, and filter on the given logName. This gives you all logs for a single session.

Visit the Stackdriver Error Reporting web UI. Here you can see statistics for the errors reported by your application.

Reliability, performance and scalability

Reliability

If there is a failure during posting to the Cloud Functions endpoint, the game clients will retry posting the same set of messages until it succeeds. With the current implementation this means that the game client will gradually consume more and more memory if the Cloud Function endpoint is down or not accepting the content. Temporary hiccups will result in entries with delayed timestamps but all messages will be delivered to the Stackdriver service.

Performance

If a game client posts messages to the Cloud Function when it is not actively deployed anywhere, it will take Google Cloud functions approximately 10 seconds to deploy it and accept the payload. Once the Cloud Function is deployed, messages are processed immediately. The Cloud Function does not buffer any messages.

The time between posting an exception message and seeing it in the Error Reporting view seems to be between 1 and 10 seconds when doing small-scale tests.

If a game client spams log messages at a high rate, it will result in rate limiting on the client side. More and more messages get queued up within the client, until either the client quits or the enqueue rate drops again.

Scalability

Each game client is by default configured to post any messages once every second. The Cloud Function takes 300ms to execute in the average case. Cloud Functions have a quota of max 400c concurrent invocations. Stackdriver Logging has a quota of max 500 write calls per second. The bottleneck is therefore with 500 concurrent clients spamming messages to the system non-stop, or with 150.000 concurrent clients that send messages (probably errors) once every 5 minutes.

Development