Open codemvp opened 8 years ago
I added Glimpse.Elmah plugin so no need to do any other plugin http://www.hanselman.com/blog/ELMAHErrorLoggingModulesAndHandlersForASPNETAndMVCToo.aspx
"Once ELMAH has been dropped into a running web application and configured appropriately, you get the following facilites without changing a single line of your code:
Logging of nearly all unhandled exceptions. A web page to remotely view the entire log of recoded exceptions. A web page to remotely view the full details of any one logged exception. In many cases, you can review the original yellow screen of death that ASP.NET generated for a given exception, even with customErrors mode turned off. An e-mail notification of each error at the time it occurs. An RSS feed of the last 15 errors from the log. A number of backing storage implementations for the log, including in-memory, Microsoft SQL Server and several contributed by the community."
to test, just raise and exception like http://localhost/AccountGo/itmsssss/1 and then go to http://localhost/AccountGo/elmah.axd
cheers
Hi Dan,
Thanks for your feedback. ELMAH is real good in handling all unhandled exceptions. However, for the error that we catch, we also want to have a single location to display the error, waring, information or fatal and probably log them in the database in some instances.
Something like this
A section just below the menu will show the error, and an "x" on the right side to close the message.
Dear codemvp, Hope you are doing well. how to incorporate this in the AccountGo. for Save, Edit and Error messages?
You can add a Helper and implement the IExceptionFilter interface where its function is will run after an action has thrown an Exception. Log4Net is fine, you just need to have a design pattern to handle your exceptions.
Yes. @codejmsaints agree.
@marvinvperez ,
Have you guys implemented the IExceptionFilter? Do you guys already have the workflow on the Saving, Editing or even avoiding the Yellow Screen of Death when retrieving a data?
If not i would love to PR and to coordinate with you guys.
Probably will wait your PR. I think on the controller side it would be straight forward. Displaying the message as in the screenshot is another thing. I think ths exception filter would be on the api? The api would return the error.
On Tue, Nov 27, 2018, 1:11 PM codejmsaints <notifications@github.com wrote:
Have you guys implemented the IExceptionFilter? Do you guys already have the workflow on the Saving, Editing or even avoiding the Yellow Screen of Death when retrieving a data?
If not i would love to PR and to coordinate with you guys.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AccountGo/accountgo/issues/21#issuecomment-441938292, or mute the thread https://github.com/notifications/unsubscribe-auth/AKMkY5UgCBgHutYO8xYq1BnJWhUxdtiYks5uzNepgaJpZM4G__gt .
Sorry i found out that my suggestion above is not useful in .Net Core, however i found a solution that you need to add a middleware to have a Global Error Handling and register it in your start up.
I first add an extension for the IApplicationBuilder
Then the created extension should register in Startup.cs
So everytime there's an exception, .net core automatically pass through in that extension:
as you can see the status code is not implemented as stated in the above screenshot.
Can we add this to the infrastructure layer so that can be use by both webapp and api?
On Tue, Nov 27, 2018, 4:49 PM codejmsaints <notifications@github.com wrote:
Sorry i found out that my suggestion above is not useful in .Net Core, however i found a solution that you need to add a middleware to have a Global Error Handling and register it in your start up.
I first add an extension for the IApplicationBuilder [image: image] https://user-images.githubusercontent.com/38581906/49072634-9a5cde00-f26b-11e8-9113-1b9ca3da7011.png
Then the created extension should register in Startup.cs [image: image] https://user-images.githubusercontent.com/38581906/49072611-8c0ec200-f26b-11e8-8c87-cc20f3629925.png
So everytime there's an exception, .net core automatically pass through in that extension: [image: image] https://user-images.githubusercontent.com/38581906/49073125-af863c80-f26c-11e8-9995-d33347538fc4.png
as you can see the status code is not implemented as stated in the above screenshot.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AccountGo/accountgo/issues/21#issuecomment-441995285, or mute the thread https://github.com/notifications/unsubscribe-auth/AKMkY6sHkKsDZSudy8YBwpdzaGtmU0TIks5uzQq6gaJpZM4G__gt .
Yes it applies to both, because we made an extension for IApplicationBuilder
That's great! On the web ui part, the next question is how to add a common place to display the message.
On Tue, Nov 27, 2018, 5:14 PM codejmsaints <notifications@github.com wrote:
Yes it applies to both, because we made an extension for IApplicationBuilder
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AccountGo/accountgo/issues/21#issuecomment-442003345, or mute the thread https://github.com/notifications/unsubscribe-auth/AKMkY5stS2Y1eLKRzITkFEYGyXdRO1R9ks5uzRCSgaJpZM4G__gt .
I believe its not possible to have a common ajax callback in the UI part, you just need to implement in each of your ajax call, like for example on React, i think there's a Axios if im not mistaken where its a promise based http client, in its callback you can specify the status code and return the appropriate error/message.
3 things I would like to see here.
On Tue, Nov 27, 2018, 5:34 PM codejmsaints <notifications@github.com wrote:
I believe its not possible to have a common ajax callback in the UI part, you just need to implement in each of your ajax call, like for example on React, i think there's a Axios if im not mistaken where its a promise based http client, in its callback you can specify the status code and return the appropriate error/message.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AccountGo/accountgo/issues/21#issuecomment-442009587, or mute the thread https://github.com/notifications/unsubscribe-auth/AKMkY3xHjzp3MU-86PlrigmxXe7xnv0Pks5uzRUhgaJpZM4G__gt .
I think you can add a something like a Notification that it pops up when there's an error message. you can use the Kendo Notification https://demos.telerik.com/kendo-ui/notification/index
I'm trying to avoid third party controls, tools or packages as much as possible specially if that's not fully open source and license can conflict with ours.
On Tue, Nov 27, 2018, 6:01 PM codejmsaints <notifications@github.com wrote:
I think you can add a something like a Notification that it pops up when there's an error message. you can use the Kendo Notification https://demos.telerik.com/kendo-ui/notification/index http://here
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AccountGo/accountgo/issues/21#issuecomment-442017592, or mute the thread https://github.com/notifications/unsubscribe-auth/AKMkY_VKDLGDNWJcIoaN0zxpRc03zlfcks5uzRuMgaJpZM4G__gt .
this Kendo components has a lot of usage, we can use this in reports, graphing for the dashboard/forecast
True Kendo has 40+ components can be use on free license. When you started using it, you will realize that what you want more is on the paid version. We cannot add something in the core code base that has potentially rely on NOT fully open source that we cannot support. The free version of Kendo has no support.
agree, i think on the displaying of message like a notification, your designer can work on that one.
Open for suggestion on what best logging framework to use. NLog? Log4Net?, etc.