Docs Menu

Docs HomeRealm

Set the Client Log Level - Flutter SDK

You can set the realm sync client log level. You might want to do this to log different amounts of data depending on the app's environment.

To learn more about all available logging levels, refer to the RealmLogLevel documentation.

Set the log level to debug or trace to diagnose and troubleshoot errors while developing your application. For production deployments, decrease the log level for improved performance.

To configure the log level, set the static property Realm.logger.level to one of the Logger levels provided by RealmLogLevel.

You must set the log level before you open a synced realm.

// Must set log level before opening synced realm.
Realm.logger.level = RealmLogLevel.error;
// Initialize app and user before can open synced realm.
final app = App(AppConfiguration(APP_ID));
final user = await app.logIn(Credentials.anonymous());
// Synced realm writes logs according to log level set above.
final realm = Realm(Configuration.flexibleSync(user, SCHEMA_OBJECTS));
←  Handle Sync Errors - Flutter SDKTroubleshooting - Flutter SDK →
Share Feedback
© 2023 MongoDB, Inc.


  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2023 MongoDB, Inc.