Debugging with Roku Server Logs

The server logs are used to debug what happens on the server. The client is a thin client, and your app logic is implemented in the server. Both the client and server can crash independently, so if you get an error on your Roku device, the server may have crashed or disconnected. You need to check the server logs to track down the issue.

Accessing the server logs

In this section you’ll find the most common ways to access the server logs.

Using the terminal

You can access the server logs by running from your project root:

./youi/build/osx/Debug/MyApp
./youi/build/linux/Debug/MyApp

Using Xcode

Another way to access the server logs is by running the server within Xcode.

  1. Open the <App_Name>.xcodeproj file. You can find the Xcode project file inside the <project>/youi/build/<platform> folder.
  2. Select your application target from the drop-down menu to the right of the Play button.
  3. Click Play at the top left.
  4. Wait for the app to start. You should see the console at the bottom.

Using the BrightScript Console

When debugging a client, it’s sometimes useful to view the server logs. You can forward the server logs to the BrightScript Console. Add the following to the client manifest file found inside the <project>/client folder:

enable_server_logging=true

After enabling server logging, you’ll see the server logs inside the BrightScript Console (port 8085). Logs appear as CLOUD_SERVER messages. For example:

[2021-09-14 21:16:30.315Z] CLOUD_SERVER: 14:16:30.085 [9479954] I/CYIShadowTreePropertyObserver: UpdateAndBroadcastChanges.

Using the Cloud Recorder

You can enable and disable the recording of messages between the server and the client with a Dev Panel toggle called the Cloud Recorder.

The recorded messages are written to a file named recording<n>.json in the application root folder (e.g.: <project>/recording0.json). The <n> suffix of the filename is a number that starts at zero when the client is started and is incremented each time recording is enabled while the server is running.

When recording is first enabled, the recording0.json file collects the messages until recording is disabled. If the recording is re-enabled while the client is running, recording1.json is created, and so on. Be aware that the recording files can be overwritten between sessions, since the filename number is reset to zero each time the server is restarted.