Skip to content

Xamarin Android and iOS Device information enrichment for Serilog

License

Notifications You must be signed in to change notification settings

TrackMan/serilog-enrichers-xamarin

Repository files navigation

Serilog Enrichers for Xamarin

Build status NuGet

Xamarin Android and iOS Device information enrichment for Serilog

Installing

Install-Package Serilog.Enrichers.Xamarin

Usage

var configuration = new LoggerConfiguration()
    // Android
    .Enrich.WithDisplayMetrics()     // Adds `DisplayMetrics` property
    .Enrich.WithFirmwareVersion()    // Adds `FirmwareVersion` property
    .Enrich.WithHardwareVersion()    // Adds `HardwareVersion` property
    .Enrich.WithDeviceId()           // Adds `DeviceId` property
    .Enrich.WithDeviceName()         // Adds `DeviceName` property
    .Enrich.WithManufacturerName()   // Adds `DeviceManufacturer` property
    .Enrich.WithDeviceOrientation()  // Adds `DeviceOrientation` property (can be expensive since it is not cached)
    .Enrich.WithPackageName()        // Adds `PackageName` property
    .Enrich.WithPackageVersionName() // Adds `PackageVersionName` property
    .Enrich.WithPackageVersionCode() // Adds `PackageVersionCode` property
    
    // iOS
    .Enrich.WithDisplayMetrics()     // Adds `DisplayMetrics` property
    .Enrich.WithSystemVersion()      // Adds `DeviceSystemVersion` property
    .Enrich.WithDeviceModel()        // Adds `DisplayModel` property
    .Enrich.WithDeviceId()           // Adds `DisplayId` property
    .Enrich.WithDeviceName()         // Adds `DisplayName` property
    .Enrich.WithPackageName()        // Adds `PackageName` property (CFBundleName)
    .Enrich.WithPackageVersionName() // Adds `PackageVersionName` property (CFBundleShortVersionString)
    .Enrich.WithPackageVersionCode() // Adds `PackageVersionCode` property (CFBundleVersion)

License

This project is licensed under the MIT License, see the LICENSE file for more information