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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:45:42+00:00 2026-05-13T09:45:42+00:00

In my application, I use log4net, with all types creating their own logger based

  • 0

In my application, I use log4net, with all types creating their own logger based on their type – e.g. :

private static readonly ILog Log = LogManager.GetLogger(typeof(Program));

As I am developing, I leave the root logger on DEBUG so as to catch all log output from my code.

However, a third party component also uses this same approach, but is generating 100s of log messages a second, none of which I am interested in.

Is it possible to use some sort of wildcarding in the logger configuration, to force all their loggers to only log at WARN, e.g. :

 <logger name="com.thirdparty.*">
    <level value="WARN"/>
  </logger>

[The exact example above, using a * doesn’t work]

  • 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-13T09:45:43+00:00Added an answer on May 13, 2026 at 9:45 am

    You can just specify part of a namespace so it will apply to all messages within that namespace (including nested).

    Here is the example I often use:

      <root>
        <level value="FATAL" />
        <appender-ref ref="RollingFile" />
      </root>
    
      <logger name="MyCompany.Web" >
        <level value="WARN" />
        <appender-ref ref="WebErrors" />
      </logger>
    
      <!-- Will log all FATALs from NHibernate, including NHibernate.SQL and all the nested -->
      <logger name="NHibernate" >
        <level value="FATAL" />
      </logger>
    

    Additionally I would recommend to read the manual. It provides a lot of explanation. For example you can read about Logger Hierarchy. Here is the quote from there:

    A logger is said to be an ancestor of
    another logger if its name followed by
    a dot is a prefix of the descendant
    logger name. A logger is said to be a
    parent of a child logger if there are
    no ancestors between itself and the
    descendant logger. The hierarchy works
    very much in the same way as the
    namespace and class hierarchy in .NET.

    and also:

    Level Inheritance:
    The inherited level for a given logger X, is equal to the first
    non-null level in the logger
    hierarchy, starting at X and
    proceeding upwards in the hierarchy
    towards the root logger.

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

Sidebar

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.