Does DotNetNuke provide any built in Error Logging framework? My client is using DotNetNuke and I don't see a global error logging framework. I see the class below with some try/catch's using them.
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);
}
}
My understanding is that you have the following options:
Log4Net is available, but most modules use the custom exceptions class within DNN which will store "events" in the EventLog table, you can access the reports for "events" including errors, from the Admin/Event Viewer page.
Typically within a module you would do something like the following.
try
{
//STUFF HERE
}
catch (Exception exc) //Module failed to load
{
Exceptions.ProcessModuleLoadException(this, exc);
}
DNN includes log4net, see this wiki article: http://dnnsoftware.com/Wiki/Page/log4net-In-DotNetNuke
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With