• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: How to add Exception handling in logger and stored in Database

Resolved: How to add Exception handling in logger and stored in Database

0
By Isaac Tonny on 16/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I want when exception throw the exception error show in logger
This is my Controller i add logger in this controller i only add visited page when i visited page that will show in logger the page is visited

Answer:

You can create an ErrorController to handle Exception, Refer to this simple Demo:
In Program.cs(.Net 6), Configure the ExceptionHandler
ErrorController
When visit this page, It will log Index page visted
enter image description here
After throw an Exception, It will catch the error then log it.
enter image description here

If you have better answer, please add a comment about this, thank you!

asp.net asp.net-core asp.net-core-mvc asp.net-mvc
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: significance letter above bar graphic in wrong order

01/04/2023

Resolved: VBA – Applying border around the areas with value/text

01/04/2023

Resolved: How can I implement a function depending on picked up items?

01/04/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.