- Notifications
You must be signed in to change notification settings - Fork18
A Serilog sink that writes events to Xamarin mobile targets
License
NotificationsYou must be signed in to change notification settings
serilog/serilog-sinks-xamarin
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
WritesSerilog events to the console of Xamarin.iOS (NSLog) / Xamarin.Android (AndroidLog).
Install fromNuGet:
Install-Package Serilog.Sinks.XamarinWhen using Xamarin.iOS
Log.Logger=newLoggerConfiguration().WriteTo.NSLog().CreateLogger();
When using Xamarin.Android
Log.Logger=newLoggerConfiguration().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 callLog.CloseAndFlush() orLogger.Dispose() when the application/activity exits.
About
A Serilog sink that writes events to Xamarin mobile targets
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors8
Uh oh!
There was an error while loading.Please reload this page.