Skip to content
Jiri Matejka edited this page Feb 6, 2019 · 9 revisions

CrossSimpleLogger - easy logging for Xamarin.Forms

It is a simple logger for Xamarin.Forms application. You can log any event occuring in your application and save it to isolated storage on a device. Then you can grab the logs and do whatever you need, eg. mail those to support, submit to a server for further analysis or so.

Nuget package

Easiest way to include CrossSimpleLogger to your app is to download and install NuGet package: https://www.nuget.org/packages/Plugin.SimpleLogger/1.1.0

Usage

Before the first use configure the logger. It is an optional step, if you leave it, it will work with default options. Example - use following method to log to files started with mylog, eg. mylog1.log, mylog2.log etc., keeping three log files of max 100 kB size. Warnings and Errors will be logged:

CrossSimpleLogger.Current.Configure("mylog", 3, 100, LogLevel.Warning)

To log an info message use:

CrossSimpleLogger.Current.Info("Application Started...")

Then there are Debug, Warning and Error methods to log events.

If you need to get the log content use:

CrossSimpleLogger.Current.GetAllLogContent()

and submit the result to your server, mail to your support email or so. Remember that the oldest events may be deleted on log rollover (number of files kept and their size depends on configuration).

Limitations

Currently Android, iOS and Universal Windows Platform are supported. Windows Phone 8.x and Windows Store 8.* apps are not supported (don't plan to implement those soon).

You can raise any question to JIRI at jirimatejka.com

Package icons made by Freepik from www.flaticon.com is licensed by CC 3.0 BY
Clone this wiki locally