Logging (Beta)

Warning: This feature is in closed beta and accessible by permission only.

Logging and analyzing logs is a basic and extremely important way of troubleshooting a game server. Although third-party logging services exist, they require additional setup and configuration before you can use them with Unity Gaming Services.

The Game Server Hosting Logging service removes the friction of setting up a logging system for Unity Cloud Dashboard projects. It provides a way to view, search, and download logs from the Unity Cloud Dashboard without setting up a custom integration with a third-party service.

By using this service, you agree that you won't allow or otherwise let any third party to transmit to Unity or store any personal data in connection with the use of the logging feature.

Note: Game Server Hosting Logging is in closed beta. Unity is collecting as much feedback as possible to improve the feature. Please share any issues, thoughts, or feedback with the engineering team.

Requirements

During the closed beta release, you must meet the following requirements to use Game Server Hosting Logging:

  • You must have activated the Game Server Hosting service.
  • Unless you set a specific logging path, Game Server Hosting looks in the /usr/local/games/**/*.log directory for logs.
  • The default file extension is .log. If you use a different file extension, you must set a custom logging path with a configuration variable or launch parameter.

Limitations

  • Log files are only maintained for seven days.
  • Logging doesn’t capture STDOUT. However, it might be added in a future release.
  • You can’t exceed more than 100 GB of logs within a 30-day period.
  • Analytic data for logs and the logging service isn’t available for the closed beta.
  • The live logs feature disables automatically when you scroll to load older logs.
  • You can’t sort logs by fields within structured logs. This is because Game Server Hosting can’t expect the log output format.

Features and roadmap

The closed beta release includes the following features and functionalities.

  • Viewing live logs for a specific server.
  • Viewing live logs for all servers in a fleet.
  • Pausing live logs.
  • Searching logs for a single server.
  • Searching logs for all servers in a fleet.
  • Download a log file that corresponds to a context.
  • Accessing logs for offline servers.
  • Filtering log files to a specific log file sequence.
  • Using log context to discover what happened before and after a log entry.
  • Activating and deactivating the logging service.
  • Logging service limit display.

The following features and functionalities are planned for future releases. Planned features are subject to change without notice.

  • Pausing logging to reduce costs.
  • Viewing standard output (STDOUT) alongside log files
  • Enabling notifications for incompatible configurations.
  • Configure custom logging limits.
  • Overriding the default maximum expense for logs.

Get started

Warning: If you haven’t already set up Game Server Hosting, refer to Get started with Game Server Hosting.

You must enable logging through the Unity Cloud Dashboard before accessing logging features.

  1. From the Game Server Hosting sidebar (under Multiplayer), select Logs.
  2. Select Enable logs.
  3. Read through the limitations dialog, then select Enable.

On the game server executable end, make sure to save log files to the correct location so Game Server Hosting knows where to find them. You can save log files to the default directory or a custom directory. If you save to a custom directory, you must specify the custom directory in the build configuration settings.

Game Server Hosting checks whether you have a custom log output directory specified by a build configuration variable or a launch parameter. If you have a custom log output directory, it uses that directory. If you haven’t specified a custom log output directory, it checks the following directory for files that end in .log:

/usr/local/games/**/*

Note: You set log output locations per build configuration. If you allocate a game server with a different build configuration, the game server might save logs to a different directory.

Guides

Explore the following guides to learn how to perform specific logging tasks within Game Server Hosting Logging.

View logs

To view game server logs:

  1. In the Unity Cloud Dashboard, open Game Server Hosting (Multiplay).
  2. Select Debugging.
  3. Select the Logging tab.

View live logs

To view live logs:

  1. In the Unity Cloud Dashboard, open Game Server Hosting (Multiplay).
  2. Select Debugging.
  3. Select the Logging tab.
  4. Select Live Logs.

While you have Live logs enabled, the log view updates with new logs as your game server runs. However, if you scroll to view older logs, Live logs are automatically disabled.

View static logs

To view static logs:

  1. In the Unity Cloud Dashboard, open Game Server Hosting (Multiplay).
  2. Select Debugging.
  3. Select the Logging tab.
  4. Select Static Logs.

While you have Static logs enabled, the log page doesn’t automatically display new logs as your game server runs.

Note: Scrolling through logs with Live logs enabled automatically enables Static logs.

Search logs

To search through logs:

  1. In the Unity Cloud Dashboard, open Game Server Hosting (Multiplay).
  2. Select Debugging.
  3. Select the Logging tab.
  4. Type the search words into the search bar.
    • If you want to automatically filter as you type, enable Filter on search.

Search fleet logs

You can search through all logs from a specific fleet by selecting the Fleet, then searching the log messages or further filtering by Date range or Servers.

  1. In the Unity Cloud Dashboard, open Game Server Hosting (Multiplay).
  2. Select Debugging.
  3. Select the Logging tab.
  4. Use the Fleet dropdown menu to select a fleet.
  5. Use the search bar to search for keywords, or search by Date range.

Search server logs

You can search through all logs from a specific game server by selecting the Server, then searching the log messages or further filtering the results by Date range.

  1. In the Unity Cloud Dashboard, open Game Server Hosting (Multiplay).
  2. Select Debugging.
  3. Select the Logging tab.
  4. Use the Server dropdown menu to select a server.
  5. Use the search bar to search for keywords, or search by Date range.

Tail log search results

You can tail log search results by activating the Live Logs feature. If the server (or fleet) is online, you can view new log entries as game servers create them.

Filter logs

To filter logs by date range, fleet, or game server:

  1. In the Unity Cloud Dashboard, open Game Server Hosting (Multiplay).
  2. Select Debugging.
  3. Select the Logging tab.
  4. Select the filter you want to use:

Filter by date range

You can filter logs by one of the pre-set date filters (such as the last 24 hours) or a custom date range.

Tip: When filtering by a custom date range, you can leave the End date blank to filter from the Start date to the current date.

  1. In the Unity Cloud Dashboard, open Game Server Hosting (Multiplay).
  2. Select Debugging.
  3. Select the Logging tab.
  4. Set Date range to Custom.
  5. Select the Start date and the End date for which to filter the logs.
  6. Select Apply. If you leave the End date blank, it defaults to the current day.

Filter by fleet

  1. In the Unity Cloud Dashboard, open Game Server Hosting (Multiplay).
  2. Select Debugging.
  3. Select the Logging tab.
  4. Use the Fleet dropdown menu to select a fleet.

Filter by server

  1. In the Unity Cloud Dashboard, open Game Server Hosting (Multiplay).
  2. Select Debugging.
  3. Select the Logging tab.
  4. Use the Server dropdown menu to select a server.

Filter by logfile

Note: You must first filter by fleet and server before you can filter by logfile.

  1. In the Unity Cloud Dashboard, open Game Server Hosting (Multiplay).
  2. Select Debugging.
  3. Select the Logging tab.
  4. Use the Logfile dropdown menu to select a logfile.

View logs in context

There are additional contextual filter options available in the More (⋮) menu for each log entry. This menu allows you to filter by fleet, filter by server, filter by log file, or view the log entry in context.

Filter on fleet

Filter on fleet filters the current log search results to only display results from the same fleet as the log entry you selected.

Filter on server

Filter on server filters the current log search results to only display results from the same server as the log entry you selected. After you select a context filter, you can further filter the results by another context.

Filter on logfile

Filter on logfile filters the current log search results to only display results from the same logfile as the log entry you selected. Filtering by logfile automatically filters results by the fleet and server associated with the logfile.

View in context

Viewing a log file in context automatically filters logs by the same fleet and server as the log entry and limits the time to five minutes before and after the entry.

Download logs

To download logs:

  1. In the Unity Cloud Dashboard, open Game Server Hosting (Multiplay).
  2. Select Debugging.
  3. Select the Logging tab.
  4. Select Download logs.

This downloads the logs you have loaded based on the current filters and search results.

If you have Live logs enabled when you select Download logs, it downloads the most recent logs. If you select Download logs after scrolling down, it also downloads all log files you have loaded in the Logs view.

You can control the logs you download by filtering the logs by date range, fleet, server, or search query. For example, to download logs for a single server within a specific date range, filter the logs with the Date range filter and the Server filter before selecting Download logs.

Download a specific log file

You can download the source log file for a specific log entry by selecting the Download source log file icon at the end of the log entry's row.

Download logs from a specific time

You can download logs from a specific time by filtering the logs by Date range, then selecting Download logs.

  1. In the Unity Cloud Dashboard, open Game Server Hosting (Multiplay).
  2. Select Debugging.
  3. Select the Logging tab.
  4. Set Date range to Custom.
  5. Select the Start date and the End date for which to filter the logs, then select Apply. If you leave the end date blank, it defaults to the current day.
  6. Select Download logs.

Download log search results

You can download the current search results by selecting Download logs. It downloads only the loaded log results by default.

Disable logs

You can disable Game Server Hosting logs at any time. After disabling logs, you won't have access to your logs or Game Server Hosting logging features.

Disabling Game Server Hosting logs doesn't delete any log files. Your servers will continue to write to the log files and you can still access the log files from the standard Game Server Hosting logs view.

Note: Game Server Hosting deletes your parsed logs from the back end service (not your log files) following a standard seven day retention period.

Troubleshooting

If logs aren't displayed in the Unity Cloud Dashboard:

  1. Make sure you’re using the default log output directory or you’ve specified a custom log output directory.
  2. If you use a file extension other than .log, make sure you have a custom log output directory.
  3. If your game uses the Unreal Engine, refer to Redirect log output for games using Unreal.

Glossary

Fleet: A fleet is a collection of servers that a Game Server Hosting (Multiplay) treats as a logical unit.

Machine: A cloud or bare-metal machine that servers are running on, a machine can have more than one servers running on it.

Server: The actual running executable of a game server binary. It can be a long-running server, where new sessions start and stop on the same execution, or a single session executable that will shut down once the session completes. The server is where developers implement their logging strategy. Each server can produce one or more log files. Log files can be long or short-lived.

Context (aka Log File): The log file is where you store the logging data. As the developer, you must know the number of files each of your servers generate, what each log file has in it, the format of the log data, and how to find information in the log file.

Live logs: Live logs, or the Live Log view, is a view in which you enable live (real-time) logs. In this view, newly generated log files automatically populate the log search results.

Static logs: Static logs, or the Static Log view, is a view in which you disable live (or real-time logs) from populating the current search results.

Filtering: Filtering refers to the process of filtering the log results by keyword, fleet, server, log, or date range.

Log files: Log files, or source log files, are the source of the information exposed on the Logs view. You can download a specific source log file from the search results.

Server logs: All log files originate from the game server executable running a game server. You can filter logs by a specific server.

Fleet logs: Fleet logs refers to all log files generated by servers within a specific fleet. You can filter logs by a specific fleet.