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 238207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:29:14+00:00 2026-05-11T20:29:14+00:00

I have an ASP.NET App that uses a .NET library. I want to enable

  • 0

I have an ASP.NET App that uses a .NET library. I want to enable logging to somewhere to check later the error messages.

I will log ASP.NET app and .NET library, to the same place or to different places. I don’t know how to do it.

I prefer to use System.Diagnostics. from .NET Framework instead of 3rd party frameworks, but I don’t know if this is the better solution.

I want to log error messages and, sometimes, custom messages.

Thank you!

  • 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-11T20:29:14+00:00Added an answer on May 11, 2026 at 8:29 pm

    There are plenty logging frameworks for .NET, If you want to have powerful and flexible logging in your application then you should use one of 3rd party frameworks, I prefer log4net. There are also several ways for doing this using only classes of .Net Framework.

    For example you can use these approaches:

    1. The simplest way will be creation of your personal implementation of logger, for example you can just use File.AppendAllText at the place you want to log something to somewhere. If you want to use SQL database as a storage for your log entries you can use SqlCommand class filled with appropriate insert query or you can define another way of logging. But this way isn’t recommended because there are many chances that others who will support your code will know usage of well known frameworks & practices and there aren’t any chances that they will know your implementation, so they probably will need to read bigger amount of code.

    2. You can use EventLog class. We have used it to log critical errors (like unhandled exceptions) happened in our services and ASP.NET applications. It will allow you to have unconditional logging to system wide storage. That storage will be accessible from Microsoft Management Console (mmc) and that storage will be configurable.

    3. You can also use something like Debug.WriteLine or Trace.WriteLine for logging. In that case you will have ability to configure log listeners via editing of web.config file. You will have ability to enable or disable of logging, change ways of logging (log to file, to event log or to something else).

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

Sidebar

Related Questions

I have an asp.net app that uses System.IO.Path.GetTempFileName() for temporary files. In the production
I have a asp.net web forms app that uses System.Web.Caching.Cache to cache xml data
We have an ASP.NET 2.0 WebForms app that uses MS Ajax 1.0. It's working
I have an asp.net/C# app that uses subversion for source control. My app automatically
I have a reporting module in an ASP.NET webforms app (C#) that uses dynamic
I have an ASP.NET web app that uses a single page, but makes some
I have an ASP.NET MVC 2 app that uses URLS such as: /rsvp/33c4cf68-a2fe-4c0f-9834-08838e0532c3 /rsvp/4f28dad7-b05c-4887-818f-b4ae664b7192
I have an asp .net webforms app that uses forms authentication. For a small
I have put together a simple ASP.NET MVC 3 test web app that uses
I have an ASP.NET app that uses a SQL Server database. I now need

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.