[UWP][C#] How to ensuring log file is written to before/on app crash RRS feed

  • Question

  • I have an application life cycle question regarding logging and how to ensure the best coverage during fatal errors. I'm currently using Windows.Foundation.Diagnostics, specifically FileLoggingSession to handle my logging. In my Application.OnSuspending() I call FileLoggingSession.CloseAndSaveToFileAsync(), the problem with this of course is that during an application crash OnSuspending isn't called. What's the best way to go about handling this?

    "Knowledge is Power. Power Corrupts. Stay in school. Be evil.

    Thursday, March 10, 2016 4:37 PM


  • Hi,

    Apps crushes frequency because  the code throw an exception that wasn't caugh , and best place to call logger in

     App.Current.UnhandledException event handler 
    Thursday, March 10, 2016 9:45 PM