-
Notifications
You must be signed in to change notification settings - Fork 568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added exception middleware to server for logging #3925
Conversation
Oqtane already has database logging for all scenarios where a tenant can be identified... and file logging for scenarios where it cannot. This PR adds more logging on top of the existing logging - which does not make sense? |
@sbwalker Oqtane has logging which I used in the middleware, |
Unhandled exceptions in module components are supposed to be caught by the ErrorBoundary which is in Oqtane.Client\UI\RenderModeBoundary.razor. The ErrorBoundary logs the detailed error and displays a friendly error message to the UI. So I am curious why your module components would not function properly. Are the module components specifying public override string RenderMode => RenderModes.Static... or are they Interactive (default)? |
@sbwalker I have the client error logging working but it is not a detailed messages it looks like this while I need the actual error stack trace and line number which the exception middleware can provide, for example:
|
Oh ok... so this is intended for server-side logging of unhandled exceptions. Did you look in the Oqtane.Server\Content\Log\error.log file to determine if these errors were logged there? This error log is also displayed in the UI when you go to Admin Dashboard / System Info and choose the Log tab. |
@sbwalker yes it is logged there, thanks for details, it is not necessary then |
@pyramidsbuilder I actually think there is value in this PR, as in those scenarios where the tenant can be determined, it can log the exception to the appropriate database (tenant) for the correct site. This keeps the exceptions grouped together and much easier to locate. And in the cases where the tenant cannot be determined, it can fallback to use the file logger. |
added exception middlware to log server exceptions