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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:44:41+00:00 2026-05-11T21:44:41+00:00

I have log4net loggers configured to run with my unit tests, but for a

  • 0

I have log4net loggers configured to run with my unit tests, but for a few select unit tests that serve as perf tests I want to disable logging. How can I disable (and later re-enable) logging at runtime, basically overriding the logger settings that are in my .config file?

  • 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-11T21:44:41+00:00Added an answer on May 11, 2026 at 9:44 pm

    on http://osdir.com/ml/windows.dotnet.log4net.user/2004-01/msg00010.html they recommend

    To disable all logging set the
    threshold level for the repository to
    OFF:

    LogManager.GetLoggerRepository().Threshold
    = LogManager.GetLoggerRepository().LevelMap[“OFF”];

    To enable logging set the threshold to
    ALL (this is the default value):

    LogManager.GetLoggerRepository().Threshold
    = LogManager.GetLoggerRepository().LevelMap[“ALL”];

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

Sidebar

Related Questions

We have an application that logs using log4net. But we would like to delete
I have a Log4Net RollingFileAppender that is configured as: <configuration> <configSections> <section name=log4net type=log4net.Config.Log4NetConfigurationSectionHandler,
I have a log4net file appender configured that all my log files should use:
I have created a simple scenario using Log4net, but it seems that my log
I have configured log4Net EventLogAppender for Asp.Net 2.0. However it does not log anything.
I only have experience with log4net however that does not mean that there are
I have two projects configured identically for log4net. One project logs fine; however, the
I want to use Log4Net in my asp.net application & I have done the
Odd one this. I am using NHibernate with one website. I have configured log4net
I have configured this filter for one of my log4net appenders (uses AdoNetAppender): <filter

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.