Copied to clipboard

Flag this post as spam?

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


  • Phil 54 posts 139 karma points
    Dec 10, 2014 @ 17:29
    Phil
    0

    7.2.0 Error logging to Umbraco database

    Hi all,

    I'm currently trying to figure out the easiest way to log any 404 errors/unhandled exceptions that occur within my Umbraco site.

    In a previous, non umbraco project that I have worked on, I have created an Errors table in the database, caught all exceptions in the Global.asax Application_Error method and saved it to the table.

    Is there an inbuilt method in Umbraco 7 to save all errors (including 404's) to the umbracoLog table, or will I still have to use the previous method?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Dec 10, 2014 @ 18:02
    Jan Skovgaard
    0

    Hi Phil

    I'm assuming you want to keep track of this for SEO reasons? It might be worth having a look at the 301 url tracker package or perhaps the SEO checker package? (Last one is commercial though).

    I know it's not a direct answer to your question but perhaps one of those 2 packages can save you some work :)

    /Jan

  • Phil 54 posts 139 karma points
    Dec 10, 2014 @ 18:31
    Phil
    0

    Jan,

    I was more thinking about user experience than SEO at this point, but the 301 Url Tracker package captures the 404 part of my issue perfectly. Thank you for recommending this!

    With this package and the Application_Error method of the Global.asax file, I have a workaround - however, I would still be interested to hear of other approaches that people may have taken to this problem?

    Many thanks.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Dec 10, 2014 @ 19:28
    Jan Skovgaard
    0

    Hi Phil

    Happy to hear that the 301 url tracker suits your needs :)

    Don't know if you could benefit from the log4net stuff as well? Ismail wrote a piece about it in the Umbraco advent calendar last year http://24days.in/umbraco/2013/log4net-in-umbraco/

    Darren Ferguson has blogged about it as well http://blog.darren-ferguson.com/2013/02/22/log4net-logging-from-your-custom-code-in-umbraco/

    If I remember correctly there was an option to write something like Log.Add() In the old API's before Umbraco 6. But I don't think that's an option using the new API's anymore. I have not been able to find the method when skimming through the documentation on this though http://our.umbraco.org/documentation/Reference/Management-v6/

    Hope this is of any help as well.

    /Jan

  • Phil 54 posts 139 karma points
    Dec 11, 2014 @ 09:38
    Phil
    0

    Jan,

    I have seen the pieces by Ismail and Darren - I will hopefully be able to use Log4Net in the Application_Error method.

    Interestingly, I have run into an issue with the above method firing twice on every error, but I will create another topic regarding that.

    Thanks again for your help!

    Edit: there is an ongoing topic about Global.asax and Application_Error here: http://our.umbraco.org/forum/developers/extending-umbraco/53344-Application_Error-and-Globalasaxcs

Please Sign in or register to post replies

Write your reply to:

Draft