locked
what are best ways to Logging and Excpetion handling in WPF? RRS feed

  • Question

  • Hi All ,

    i am working on WPF Application and trying to get input you people , what are best techinique to use logging and exception  handling, i am looking more about logging mechanism, which may be in build in WPF and i am not aware?

    Thanks


    Ashok
    Wednesday, February 1, 2012 9:51 PM

Answers

  • There are many frameworks around, or you can roll your own, but in the end I have just started using the most popular and regularly supported, Log4Net.

    It's very easy to set up and threadsafe.

     

    Here's the toppest tip I can offer - Get NuGet it is a Visual Studio extension, that you open through Tools / Library Package Manager.

    It opens a window that finds and sorts by popularity all the standard open source projects.

    It has a search feature, search it for "Log4Net", then click "Install". Also great for other essential frameworks like MVVMLite.

     

    With Log4Net, you will need to set up your "listeners" in App.xaml, which can be multiple outputs like file, database, etc.

     

    Regards,
    Pedro


    [Note: I have no vested interests in any of these products, they are just my own favourite tools that make my life a little easier]

    • Edited by Pete LakerMVP Wednesday, February 1, 2012 10:10 PM
    • Proposed as answer by Sheldon _Xiao Friday, February 3, 2012 5:18 AM
    • Marked as answer by Sheldon _Xiao Thursday, February 16, 2012 9:05 AM
    Wednesday, February 1, 2012 10:03 PM

All replies

  • There are many frameworks around, or you can roll your own, but in the end I have just started using the most popular and regularly supported, Log4Net.

    It's very easy to set up and threadsafe.

     

    Here's the toppest tip I can offer - Get NuGet it is a Visual Studio extension, that you open through Tools / Library Package Manager.

    It opens a window that finds and sorts by popularity all the standard open source projects.

    It has a search feature, search it for "Log4Net", then click "Install". Also great for other essential frameworks like MVVMLite.

     

    With Log4Net, you will need to set up your "listeners" in App.xaml, which can be multiple outputs like file, database, etc.

     

    Regards,
    Pedro


    [Note: I have no vested interests in any of these products, they are just my own favourite tools that make my life a little easier]

    • Edited by Pete LakerMVP Wednesday, February 1, 2012 10:10 PM
    • Proposed as answer by Sheldon _Xiao Friday, February 3, 2012 5:18 AM
    • Marked as answer by Sheldon _Xiao Thursday, February 16, 2012 9:05 AM
    Wednesday, February 1, 2012 10:03 PM
  • Hi Ashok,

    I am marking your issue as "Answered", if you have new findings about your issue, please let me know.

     

    Best regards,


    Sheldon _Xiao[MSFT]
    MSDN Community Support | Feedback to us
    Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, February 16, 2012 9:06 AM