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
ErrorControllerto handle Exception, Refer to this simple Demo:
Program.cs(.Net 6), Configure the ExceptionHandler
Index page visted
After throw an Exception, It will catch the error then log it.
If you have better answer, please add a comment about this, thank you!