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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:09:13+00:00 2026-06-09T08:09:13+00:00

I try to find a way to set isdebugenabled false or true in configuration

  • 0

I try to find a way to set isdebugenabled false or true in configuration file,

so I can turn it on or off whenever I need. Thanks !

  • 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-06-09T08:09:16+00:00Added an answer on June 9, 2026 at 8:09 am

    Using a really simple logging setup

    <targets>
      <target xsi:type="File"
              name="debug"
              fileName="c:\temp\debug.txt"
              layout="${longdate} ${uppercase:${level}} ${message}" 
      />
    </targets>
    
    <rules>
      <logger name="*" minlevel="Trace" writeTo="debug" />
    </rules>
    

    And an equally simple code sample

    class Program
    {
        static void Main(string[] args)
        {
            var logger = new NLog.LogFactory().GetCurrentClassLogger();
    
            if (logger.IsDebugEnabled)
            {
                logger.Debug("this is a debug message");
            }
    
            logger.Debug("this is another debug message");
        }
    }
    

    When minLevel is set to Debug or Trace, both logger.Debug statements will write to the log. If you raise minLevel to a higher level (Info, Warn, Off) neither statement will be written to the log. logger.Debug checks IsDebugEnabled (which is inferred from the log level).

    You can certainly get a performance increase (in cases where you are going to be logging calculated values and not just strings) by checking IsDebugEnabled, and changing minLevel for the logger is the way to toggle this.

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

Sidebar

Related Questions

I have been through every option to try to find a way to get
I really try to find on google how can we convert .doc and .txt
I need to find a way to determine if the Visible property of a
Can I optimized the following query in any way: The goal is to try
I'm trying to find a way to read in a WSDL file (I will
I have been searching all over the net to try and find a way
I've been reading the documentation but I can't find a way to do this.
Is there a way (or can anyone find a way) to import IronScheme into
When I try to find out the total count of delicious bookmarks, Delicious returns
I have used DLL Export viewer to try and find the functions that are

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.