tafuji / Xamarin-Forms-NLog-Sample

Simple Xamarin.Forms logging sample with NLog
30 stars 14 forks source link

Change LogLevel on the fly? #7

Closed K232 closed 4 years ago

K232 commented 4 years ago

Hi! Is it possible to change the loglevel on the fly, e.g. with a button in the app? The user should be able to manually enable the logging (= set loglevel to Debug), later on disable again (what would be the best regarding performance for that?) and then e.g. mail it to me. Would that be possible? Many thanks!

tafuji commented 4 years ago

This code might be helpful.

https://gist.github.com/pmullins/f21c3d83e96b9fd8a720

tafuji commented 4 years ago

@K232 I've updated the sample codes to change the loglevel. Please see the codes. I hope it will be helpful for you.

https://github.com/tafuji/Xamarin-Forms-NLog-Sample/blob/master/NLogSample/NLogSample.Logging/LoggingService.shared.cs#L76

K232 commented 4 years ago

Thanks Tafuji!