Writes Serilog events to the console of Xamarin.iOS (NSLog) / Xamarin.Android (AndroidLog).
Install from NuGet:
When using Xamarin.iOS
Log.Logger = new LoggerConfiguration() .WriteTo.NSLog() .CreateLogger();
When using Xamarin.Android
Log.Logger = new LoggerConfiguration() .WriteTo.AndroidLog() .Enrich.WithProperty(Constants.SourceContextPropertyName, "MyCustomTag") //Sets the Tag field. .CreateLogger();
Within your portable class libary or within your application
Log.Information("This will be written to either NSLog or AndroidLog");
Because the memory buffer may contain events that have not yet been written to the target sink, it is important to call
Logger.Dispose() when the application/activity exits.
About this sink
This sink is maintained by Geoffrey Huntley.