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?
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 :)
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?
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/
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?
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
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.
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
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-Globalasaxcsis working on a reply...