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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:59:06+00:00 2026-05-18T11:59:06+00:00

I need to configure logger to write messages to several appenders with different Log

  • 0

I need to configure logger to write messages to several appenders with different Log Levels.

For ex. I want RefreshDataService to log detailed info to TransportFileAppender and Warnings and Errors to RollingFileAppender.

Also, I’m using buffering to improve logging performance.
I setup FilteredFileLog appender to forward Warnings to FileLog->RollingFileAppender.

But for RefreshDataService logger, all log messages including debug and Info getting logged to FileLog.

Can you help me to configure the RefreshDataService logger to log only Warn+ messages to FileLog? Thanks.

Below is excerpt from my log4net config.

<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
  <file value="${TEMP}\logs\client\${ENV}\client.log" />
  <appendToFile value="true" />
  <rollingStyle value="Size" />
  <maxSizeRollBackups value="10" />
  <maximumFileSize value="4096KB" />
  <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%date [%thread] %-5level [%property{ENV}] [%property{UID}] %logger - %message%newline" />
  </layout>
</appender>

<appender name="TransportAppender" type="log4net.Appender.RollingFileAppender">
  <file value="${TEMP}\logs\client\${ENV}\client.comm.log" />
  <appendToFile value="true" />
  <rollingStyle value="Size" />
  <maxSizeRollBackups value="10" />
  <maximumFileSize value="4096KB" />
  <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
  </layout>
</appender>


<appender name="DetailedTransportLog" type="log4net.Appender.BufferingForwardingAppender">
  <threshold value="DEBUG" />
  <bufferSize value="200" />
  <appender-ref ref="TransportAppender" />
</appender>

<appender name="FileLog" type="log4net.Appender.BufferingForwardingAppender">
  <bufferSize value="20" />
  <lossy value="false" />
  <appender-ref ref="RollingFileAppender" />
</appender>

<appender name="FilteredFileLog" type="log4net.Appender.ForwardingAppender">
  <threshold value="WARN" />
  <appender-ref ref="FileLog" />
</appender>

<logger name="RefreshDataService" >
  <level value="DEBUG" />
  <appender-ref ref="FilteredFileLog" />
  <appender-ref ref="DetailedTransportLog" />
</logger>
  • 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-18T11:59:07+00:00Added an answer on May 18, 2026 at 11:59 am

    You can use a level range filter on the appender:

    <filter type="log4net.Filter.LevelRangeFilter">
        <levelMin value="WARN" />
        <levelMax value="FATAL" />
    </filter>
    <filter type="log4net.Filter.DenyAllFilter" />
    

    My understanding is that the Threshold property is used tell the appender to flush the buffer when messages of a certain level are logged. This way you can make for instance sure that errors are written immediately to the database.

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

Sidebar

Related Questions

I need to log debugging messages from the same class into different files. What
In my java days I used to configure the logger so that different classes
I need to configure 'Client certificate authentication' in Glassfish 3. I tried many scenarios
What would I need to configure and what would automatically work? As far as
I'm currently working on a NuGet package which need to configure a couple of
I have a windows application (C#) and i need to configure it to run
In my program I need to programmatically configure an ApplicationContext. Specifically, I have a
I need to set/unset configure options for an in-house C# software through its GUI.
I need to setup ActiveMQ with MySQL which i follow this article http://note19.com/2007/06/23/configure-activemq-with-mysql/ I
What's the code syntax, and what all do I need to install and configure,

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.