You need to create a class that inherits UmbracoApplicationBase, you can add your error handler to this and then change the inherits value in global.asax.
looking at the umbraco base code, my guess would be that the logger may not be instantiated at the point you are trying to use it,
There is a function in the core UmbracoApplication class that instantiates the logger. Also since you are overriding OnApplication error it is quite possible that your error will occur before the application is loaded and would therefore never get logged by Umbraco.
if you are inheriting from UmbracoApplication, you could try something like
logging error in global.asax
Hi,
Can any one let me know on how to log error in OnApplicationError in global.cs
You need to create a class that inherits UmbracoApplicationBase, you can add your error handler to this and then change the inherits value in global.asax.
Check this post for some info https://our.umbraco.com/forum/developers/extending-umbraco/53344-Application_Error-and-Globalasaxcs#comment-201419
Hi Reddik,
My class is getting pickup and Application_error method is working. But the below line of code is not writing any log.
looking at the umbraco base code, my guess would be that the logger may not be instantiated at the point you are trying to use it,
There is a function in the core UmbracoApplication class that instantiates the logger. Also since you are overriding OnApplication error it is quite possible that your error will occur before the application is loaded and would therefore never get logged by Umbraco.
if you are inheriting from UmbracoApplication, you could try something like
is working on a reply...