Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dawid 26 posts 136 karma points c-trib
    Mar 20, 2018 @ 11:51
    Dawid
    0

    How to catch un handled exceptions before they are logged with log4net to add more information to it?

    How to catch un handled exceptions before they are logged with log4net to add more information to it?

  • Dan Diplo 1554 posts 6205 karma points MVP 5x c-trib
    Mar 20, 2018 @ 13:09
    Dan Diplo
    0

    The only way would be to catch the exception yourself and then log it using the LogHelper class ie.

    try
    {
        /// do something
    }
    catch (Exception ex)
    {
        global::Umbraco.Core.Logging.LogHelper.Error(this.GetType(), "Your message", ex);
    }
    

    See Debugging Docs for more info on Logging.

  • Dawid 26 posts 136 karma points c-trib
    Mar 20, 2018 @ 14:26
    Dawid
    0

    Yeah, but my scenario is when I'm not able to catch this exception. It is generated by ImageProcessor and I wanted to know for what url it is thrown.

  • Poornima Nayar 106 posts 276 karma points MVP 5x c-trib
    Mar 21, 2018 @ 09:27
    Poornima Nayar
    0

    Cant you add more try.. catch blocks around the imageprocessing bit and log your extra information?

Please Sign in or register to post replies

Write your reply to:

Draft