Hi, i use .Net Sdk , and need more log info. Where i can find examples of SDK setting loglevel and use it.
thanks
best regards
Hi, i use .Net Sdk , and need more log info. Where i can find examples of SDK setting loglevel and use it.
thanks
best regards
It can be configured under the Sync App Class like so -
public partial class App : Application
{
private const string appId = "YOUR REALM APP ID";
public static Realms.Sync.App RealmApp;
public static Realms.Sync.AppConfiguration appConfiguration;
public App()
{
InitializeComponent();
}
protected override void OnStart()
{
appConfiguration = new AppConfiguration(appId)
{
LogLevel = LogLevel.All,
CustomLogger = ((str, level) => {
Console.Write(str);
})
};
Hi,
AppConfiguration.LogLevel is marked as obsolete, with message “Configure the Global RealmConfiguration.LogLevel instead”.
CustomLogger is deprecated.
Thanks
The deprecation message is misleading and we’ve corrected it, but haven’t released the fix yet. You can use the Logger
class:
using Realms.Logging;
...
Logger.LogLevel = LogLevel.All;
// If you want to customize the logging function:
Logger.Default = Logger.Function(message =>
{
// Do something with the message
});
I am not getting any log messages in the console. Do you have a sample Xamarin.Forms project example?
Logger.Console.Log(LogLevel.All, “Hello”);
Do you see Console.WriteLine
messages - e.g. if you replace that code with Console.WriteLine("Hello")
, do you see the message appear?
I am getting Hello to print on the Android project but not the Windows project (Xamarin.Forms). That’s Okay, but we are trying to find a Log Entry for a “Realms.Exceptions.RealmException: null” in a try catch block.
I’m sorry, but I don’t understand what the problem is and how it’s related to Logger.Console
. It uses Console.WriteLine
under the hood for Xamarin projects, so it should behave fairly similarly. Your issue doesn’t appear to be related to the original question, so it’s probably better to create a new post providing more information about what doesn’t behave as expected, or - if you believe this is a bug - file a new bug report with the .NET repo: Sign in to GitHub · GitHub.
I am trying to view the trace logs. Are the logs displayed in the Realm server side logs or in the output console?
They are output in the console - they are not sent to the server.
Topic | Replies | Views | Activity |
---|---|---|---|
Should we pass Realm objects between screens or should we be converting to a js object and passing that instead? | 0 | 593 | May 2024 |
Error while updating object property in flutter. Error code: 2005 | 8 | 894 | Jun 2024 |
No default value for List type property in the generated RealmModel? | 2 | 432 | Jun 2024 |
Librealm_dart.dylib: No such file or directory | 3 | 296 | Aug 2024 |
Relationship loss when updating object | 0 | 77 | Aug 2024 |