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

  • Home
  • SEARCH
  • 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 6066839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:32:36+00:00 2026-05-23T09:32:36+00:00

I have a large application (>50k loc) in C# using NLog for tracing, and

  • 0

I have a large application (>50k loc) in C# using NLog for tracing, and the tracing has gotten somewhat out of control. Some libraries embrace proper tracing (correct level / verbosity), others just send everything to Error/Info level.

I need to clean this up in order to make all errors reflect the correct severity. As a result we have essentially disabled production tracing, when I really want to reenable general exception tracing to keep track of production problems.

What is a good workflow for tacking this? Are there any tools to help track down all trace statements in a clean fashion? I am currently planning to use re sharper and find all usages, and just spend some time tackling this.

Update: I wasn’t clear here, I am looking for some good guidelines on tracing in general, and perhaps some suggestions on the best way to retool my large code base.

  • 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-23T09:32:36+00:00Added an answer on May 23, 2026 at 9:32 am

    This is what I use (but I use log4net, but I guess its the same)

    .trace() – is to be used to record stuff like function entry and exits, and huge datadumps

    for(a in l) { trace("List contents: "+ a) }
    

    .debug() – is to print 1 (one) line of information complete when considering a branch.
    You may have several debug statements in a single function, but not 1 pr line.
    When you read the debug statements, it should read like a terse version of the
    function.

    .debug("Checking if current account {} for user {} has more than {} amount", amount);
    .debug("Account criteria met for account {} for user {}; making withdrawel of {}", otheramount);
    .debug("Account {} debited by {} amount. Transaction key {}");
    

    Every debug line must stand alone, and contain all information required to understand it. Its no good having a line just read “Checking account level”, because your next question will be which account? what user? what amount?

    .info() – At most 1 or two pr function, and only in the high level scope. Must be data complete.

    .info("Withdrawel procecss complete for account {}, user {}, for amount {}");
    

    .warn() – Non critical errors, data complete, so you can pass these to a mailer logger, and check that mailbox once in a while.

    .error() – same as warn, but more important. User was actively blocked from achieving his goal, so you want to review those more often.

    .fatal() – Should go directly to pager of sysadm, if possible with information about server/machine name.

    Aside from this, make sure each class has its own logger, based on that class, so you can easily turn logs on and off for specific areas of the code, even at runtime.

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

Sidebar

Related Questions

I have a large application (~50 modules) using a structure similar to the following:
I have a rather large application that has literally a hundred DDLs with Yes
I have a large PHP application. After I changed some settings I get a
I have a large .NET web application. The system has projects for different intentions
I have a large Java Web Application project using Maven and I need to
We have a large application that has 21 view controllers - all in a
Setting: Java 5 - no upgrade possible. I have a large application that has
We have a large legacy application where we want to start using MVC for
I have a large application written using .Net remoting for file transfer. This was
I have a relatively large application written in Python and using PyQT as a

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.