DotNetNuke and error logging

Does DotNetNuke provide a built-in error framework? My client uses DotNetNuke, and I do not see a global error logging system. I see the following class with try / catch.

namespace DotNetNuke.Services.Exceptions { [StandardModule] public sealed class Exceptions { public static ExceptionInfo GetExceptionInfo(Exception e); public static void LogException(Exception exc); public static void LogException(ModuleLoadException exc); public static void LogException(PageLoadException exc); public static void LogException(SchedulerException exc); public static void LogException(SecurityException exc); public static void LogSearchException(SearchException exc); public static void ProcessModuleLoadException(Control ctrl, Exception exc); public static void ProcessModuleLoadException(PortalModuleBase objPortalModuleBase, Exception exc); public static void ProcessModuleLoadException(Control ctrl, Exception exc, bool DisplayErrorMessage); public static void ProcessModuleLoadException(PortalModuleBase objPortalModuleBase, Exception exc, bool DisplayErrorMessage); public static void ProcessModuleLoadException(string FriendlyMessage, Control ctrl, Exception exc); public static void ProcessModuleLoadException(string FriendlyMessage, Control ctrl, Exception exc, bool DisplayErrorMessage); public static void ProcessModuleLoadException(string FriendlyMessage, PortalModuleBase objPortalModuleBase, Exception exc, bool DisplayErrorMessage); public static void ProcessPageLoadException(Exception exc); public static void ProcessPageLoadException(Exception exc, string URL); public static void ProcessSchedulerException(Exception exc); } } 
+7
source share
4 answers

DNN includes log4net, see this wiki article: http://dnnsoftware.com/Wiki/Page/log4net-In-DotNetNuke

+5
source

Log4Net is available, but most modules use their own exception class in DNN, which will store "events" in the EventLog table, you can access reports for "events", including errors, from the "View Administrator / Events" page.

Usually in a module you do something like the following.

 try { //STUFF HERE } catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } 
+19
source

A lot of time has passed since the original publication about this and after several studies for myself, I believe that I have found a better and more recent resource than the accepted answer. Below is a little information on how to configure and integrate Log4Net into your modules, http://www.dnnsoftware.com/community-blog/cid/141723/Using-log4net-with-DotNetNuke .

It seems like one of the benefits of using the Log4Net approach is the ability to customize the logging level so that applications can be more easily explored and debugged. This can be especially useful when moving applications between environments. I used this when debugging an application on a server on which I cannot connect to the process, and interupt the application for debugging. I raise the level of journaling and work with information in the journal. This can be a painful, painful way to debug, but very useful when you get stuck.

In DNN 7, the DnnLog class mentioned here depreciates, so alternatives should probably be explored.

It appears that the custom exception class is for exceptions that need to be logged in all cases. I found this slightly older article, which is probably still relevant if there is a need to register custom information, http://www.ifinity.com.au/Blog/EntryId/114/Creating-Exception-Logging-with- Dotnetnuke . Some classes will need to be updated, but the general technique looks good and more closely matches Chris's suggestion above. With a little tweaking, this example can be used to implement a custom logging level.

+4
source

I understand that you have the following options:

0
source

All Articles