Docs Menu
Docs Home
/ /
Atlas Device SDKs

Logging - Flutter SDK

On this page

  • Set or Change the Realm Log Level
  • Customize the Logger
  • Turn Off Logging

You can set or change your app's log level when developing or debugging your application. You might want to change the log level to log different amounts of data depending on your development needs. You can specify different log levels or custom loggers on a per-isolate basis.


See also:

This page shows how to set a Realm logger, which was added in Realm Flutter SDK v1.1.0. This supersedes setting the Sync client log level in earlier versions of the Realm Flutter SDK. For information on how to set the Sync client log level in an earlier version, refer to Set the Client Log Level - Flutter SDK.

You can set the level of detail reported by the Realm Flutter SDK on a per-isolate basis. To configure the log level, set the static property Realm.logger.level to one of the constants provided by RealmLogLevel.

Realm.logger.level = RealmLogLevel.trace;

You can set different log levels for different isolates, or change the log level to increase or decrease verbosity at different points in your code. This behavior differs from the deprecated sync client log level, which had to be set before opening a synced realm and could not be changed.

// Set a default log level that's not too verbose
Realm.logger.level =;
// Later, change the log level to debug an issue when running specific code
Realm.logger.level = RealmLogLevel.trace;

The Realm Flutter SDK can use a custom logger that conforms to the Dart Logger class.

To set a custom logger, create a Logger and set it using the Realm.logger static property from the first isolate:

Realm.logger = Logger.detached("custom logger");

This sets the logger for Realm logging in this isolate. If you do not provide a logger, the isolate gets a logger instance by default. You can attach to listen to the default logger using Realm.logger.onRecord.listen:

Realm.logger.onRecord.listen((event) {
// Do something with the log event - for example, print to console
print("Realm log message: '$event'");

Only the first isolate that is using Realm prints the log messages. Any new spawned isolates that work with Realm get a new Realm.logger instance, but do not print by default.

The default log level is You can change the log level per-isolate.

You can turn off logging by setting the log level to

Realm.logger.level =;

Or you can clear all Realm.logger listeners:


If you turn off logging from the first isolate, this stops the default printing logger.

← Test & Debug - Flutter SDK