0
votes

We have a custom module on a dnn page that throws a Page_Load_Exception but does not include a stack trace in the EventLog*. The exception occurs apparently before our module is loaded, and our module works fine in other environments.

  1. Is there a setting somewhere the disables or enables getting stack traces?

  2. Now, in development, if I force Page Load Exceptions, I do get a stack trace, but in trying to figure out why I looked at the DNN code and noticed this in PageBase.cs

    protected override void OnError(EventArgs e) { base.OnError(e); Exception exc = Server.GetLastError(); Logger.Fatal("An error has occurred while loading page.", exc);

From what I've read, there's evidently some cases in asp.net where Server.GetLastError() will return null. A technique for avoiding this is to deal with Server.GetLastError() in global.asax and then stash it for later use by pages. Do you think this could be a cause in DNN of us ultimately not getting a stack trace?

1
What version of DNN are you on? You can get more information from the application file logs in /portals/_default/Logs. - Fix It Scotty
DNN 8. I'll check /portals/*/Logs. But, do you know if there is something that enables or disables stack traces? - TJ Bandrowsky

1 Answers

0
votes

Just as one piece of information. The DNN log was not including the stack trace because the AddLog stored procedure was not updated. As one commentator wrote, you can check /portals/_default/Logs. There you'll see a bunch of files and have exceptions for the DNN log. In there was an exception for AddLog. Once we determined the table structures matched the upgrade, all we had to do was apply the new stored procedure.