Yes, you can do all that you are talking about. However, I suggest that you use Localdb for a MS SQL Server detached MDF file from the database engine for MS SQL Server hosted by the server, in case it goes down. The detached MDF file using Localdb would
be on a per application basis. A lot of the free 3rd party logging frameworks like Log4NET and others have built-in database technology to log to a custom database table for logging.
You should also think about using global exception handling to eliminate try/catches all over the code.
While you are already revamping everything, did you consider using a cloud-based platform. There are a lot of projects out there, that specialize in collecting log data through log4net (and other logging frameworks) and presenting them in a nice way. Here's
a few: elmah.io,
Loggly, and Logentries.
Member
112 Points
112 Posts
Error Logging - what to store and where to store
Feb 05, 2020 03:13 PM|dbqasp|LINK
I would really appreciate if some of you can comment from your company's experience on how and what do you log in your web applications.
We are an extremely small team. We have close to 20 .net apps of medium size. Not consistent but many of them use log4net.
We would like to revamp our error handling. May be have a dashboard storing errors of all the apps.
To achieve this, we plan to have a SQL table with following columns
We plan to use error email mechanism whenever an exception is raised.
Just looking forward to know the logging infrastructure you guys have in your team.
Thank you.
Contributor
4923 Points
4198 Posts
Re: Error Logging - what to store and where to store
Feb 05, 2020 07:53 PM|DA924|LINK
Yes, you can do all that you are talking about. However, I suggest that you use Localdb for a MS SQL Server detached MDF file from the database engine for MS SQL Server hosted by the server, in case it goes down. The detached MDF file using Localdb would be on a per application basis. A lot of the free 3rd party logging frameworks like Log4NET and others have built-in database technology to log to a custom database table for logging.
You should also think about using global exception handling to eliminate try/catches all over the code.
https://stackify.com/csharp-catch-all-exceptions/
Contributor
2611 Points
2707 Posts
Re: Error Logging - what to store and where to store
Feb 07, 2020 04:21 PM|wavemaster|LINK
I use Elmah for raising the exceptions and looking at the error pages after the fact. Elmah fills a SQL CE table
NLog for to be able to follow the flow of things within functionality groups, or to see how users move through the app
Twilio SMS for something that needs immediate attention.
Member
50 Points
19 Posts
Re: Error Logging - what to store and where to store
Feb 07, 2020 06:10 PM|ThomasArdal|LINK
While you are already revamping everything, did you consider using a cloud-based platform. There are a lot of projects out there, that specialize in collecting log data through log4net (and other logging frameworks) and presenting them in a nice way. Here's a few: elmah.io, Loggly, and Logentries.