Docs Menu

Docs HomeRealm

Logging - .NET SDK

On this page

  • Set the Client Log Level
  • Customize the Logging Function

To control which messages are logged by the client logger, use LogLevel:

Logger.LogLevel = LogLevel.Debug;


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

To set a custom logger function, set Logger.Default to a custom Logger function.

using Realms.Logging;
Logger.LogLevel = LogLevel.All;
// customize the logging function:
Logger.Default = Logger.Function(message =>
// Do something with the message
←  Use Realm in a Console App - .NET SDKPlatform and Framework Compatibility - .NET SDK →
Share Feedback
© 2023 MongoDB, Inc.


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