Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 804291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:53:43+00:00 2026-05-14T23:53:43+00:00

I am working on building a web service (using c#) and this web service

  • 0

I am working on building a web service (using c#) and this web service will use a MS SQL Server database. Now, I am trying to build an (exceptions log system) for this web service. Simply, I want to save every exception on the web service for future use (bug tracing).

Where is the best place to save these exceptions? Is it good idea to save it in the database? What if the exception is in the connection to the database itself?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T23:53:44+00:00Added an answer on May 14, 2026 at 11:53 pm

    You have 3 options:

    1. Log file – good option which I actually prefer to use because I can easily deal with entries and look through it. I even make directories for the log files with the following format AppName\YYYY\MM\DD\yourfile.log so that I can see how things looked on a specific day (Have years of logging in some cases). Threading is not an issue. You can make it thread safe. This is a pretty safe method because you would almost always have access to write to disk unless your disk is full, which one of the other options should be able to handle.

    2. Database – also good because you can query it easily. It has a large chance of failure and shouldn’t be used for primary logging in my opinion. If you DB goes down is experiencing issues which cause the exception, where would you store it? Your DB could be lagging and getting timeouts etc. It can also impact your DB performance depending on how much your logging.

    3. System event log – this goes great with 1 or 2 or both. The event log will almost always be available and this is what Windows uses (assuming a windows server) so it is very safe. You can also make app specific exceptions so you can filter out all the Windows specific stuff that you don’t want to worry about. It does however only store a specific amount so your history can be short depending on how much is getting thrown in there so you might want to have a way of exporting this data on a schedule.

    Most of my apps use a combination of 1 and 2. We rolled our own logging and it has worked well for us but there are some great libraries out there to help with this. We also have an in house built tool to monitor our server event logs for our specific items and notify the correct people based on specific criteria when possible. It is setup as a pull process from another server so that even when the server has issues where it maybe can’t send out a notification, the monitoring server should be able to eventually get the data out and perform the correct notification.

    The key, depending on how important logging is to you and your application, is redundancy. If you go the DB route, have a backup. If you go the file route, have a backup. In most cases logging can fail in specific cases so it is important to have more than one way to store the information you will need. It has saved me a ton of time figuring out issues when one of the logging methods failed for whatever reason.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ive been trying to get an example Web Service working using SpringWS and Tomcat5.5
I'm working on building a development tool that is written in JavaScript. This will
I've been working with JAX-WS with Weblogic Server, using their Ant tasks to build
I'm building a web application in python. A part of this application is working
I am building a utility page for a web app that I am working
I'm slowly building my application to a working state. I'm using two functions called
I'm using jQuery validate on a form I am building and it is working
I am working on an iPad app that is fed data via web service
I am building a web application that uses a lot of Javascript. Now I
We are building a web application using SVG & JS. The log file for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.