This project is part of the ChilliSource framework developed by BlueChilli.
This library provides a Raygun logging sink and Serilog based logging extensions and helper classes to simplify the instantiation and usage of Serilog logging functionality.
You need to first create a LoggerConfiguration
instance and specify the type of logging sink that receives the logged data. Currently ChilliSource.Mobile.Logging
only provides a Raygun sink, however you can add additional sinks if you wish.
var config = new LoggerConfiguration()
.MinimumLevel.Verbose()
.WriteTo.Raygun("RaygunAPIKey");
Then create the logger from the configuration:
ILogger logger = config.BuildLogger();
You can now use the logger to capture errors, warnings, information, and debugging data:
logger?.Error(ex, message);
logger?.Warning(message);
logger?.Information(message);
logger?.Debug(message);
The ChilliSource.Mobile
frameworks perform their own logging using the ILogger
interface (available in ChilliSource.Mobile.Core).
In order to let the frameworks log their data, simply create a new logger as outlined above and pass it as a parameter to one of the relevant methods or constructors.
For example, to use Raygun logging for the BeaconService
in ChilliSource.Mobile.IoT.Beacons
framework, write the following code:
var logger = new LoggerConfiguration()
.MinimumLevel.Verbose()
.WriteTo.Raygun("RaygunAPIKey")
.BuildLogger();
var beaconService = DependencyService.Get<IBeaconService>();
beaconService.InitializeService(BeaconMonitoringType.RegionMonitoring, logger);
The library is available via NuGet here.
See the releases.
Please see the Contribution Guide.
ChilliSource.Mobile is licensed under the MIT license.
For questions or feedback, please contact chillisource@bluechilli.com.