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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:35:23+00:00 2026-05-26T10:35:23+00:00

I have a client-side application that uses log4net’s RollingFileAppender and that can be instantiated

  • 0

I have a client-side application that uses log4net’s RollingFileAppender and that can be instantiated multiple times. Initially I’ve written all my logs into a single file, however, I’ve realized soon enough that log4net locks the file while writing, though, even if I used a less restrictive writing mode, I would still end up with a lot of mess in my log files.

I’ve decided to incorporate process-id into the file name, like so:

<appender name="HumanRollingLog" type="log4net.Appender.RollingFileAppender">
  <file type="log4net.Util.PatternString" value="Log\TestLog[%processid].txt"/>
  <param name="DatePattern" value="dd.MM.yyyy'.log'"/>
  <appendToFile value="true"/>
  <rollingStyle value="Size"/>
  <staticLogFileName value="true" />
  <maxSizeRollBackups value="10"/>
  <maximumFileSize value="1KB"/>
  <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%date [%type] [%thread] %-5level %logger - %message%newline%exception%"/>
  </layout>
</appender> 

That worked. However, it completely messed up the rolling features since now every process spawns its own log file, the actual rolling would happen only after process ids start repeating. E.g, starting my application 3 times resulting the following logs being created:

TestLog[5396].txt
TestLog[5396].txt.1
TestLog[5396].txt.10
TestLog[5396].txt.2
TestLog[5396].txt.3
TestLog[5396].txt.4
TestLog[5396].txt.5
TestLog[5396].txt.6
TestLog[5396].txt.7
TestLog[5396].txt.8
TestLog[5396].txt.9
TestLog[5976].txt
TestLog[5976].txt.1
TestLog[5976].txt.10
TestLog[5976].txt.2
TestLog[5976].txt.3
TestLog[5976].txt.4
TestLog[5976].txt.5
TestLog[5976].txt.6
TestLog[5976].txt.7
TestLog[5976].txt.8
TestLog[5976].txt.9
TestLog[6860].txt
TestLog[6860].txt.1
TestLog[6860].txt.10
TestLog[6860].txt.2
TestLog[6860].txt.3
TestLog[6860].txt.4
TestLog[6860].txt.5
TestLog[6860].txt.6
TestLog[6860].txt.7
TestLog[6860].txt.8
TestLog[6860].txt.9

Anyone has an idea what can I do to resolve this issue? I’d like to have each process its own file, but I can’t allow the rolling to be reused among ALL the processes.

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-05-26T10:35:23+00:00Added an answer on May 26, 2026 at 10:35 am

    If you insist on using a process identifier in the name of the log file, then the built-in rolling patterns will never work. I would like to explore your requirements. What does “I would still end up with a lot of mess in my log files” really mean? What answers are you trying to get from your log files?

    A solution to a different problem is to append the process id to the log messages and filter/search with one of the many tools available (log4net dashboard, log4net viewer, Apache Chainsaw, Microsoft LogParser, or Kiwi LogViewer.

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

Sidebar

Related Questions

I have a client side application that uses Kerberos authentication to connect to remote
I have an ASP.NET web application that uses jQuery on client side. On one
We have a client side application (Java/Swing) that we need an HTML rendering control
I have a distributed windows application (written in C#) that currently uses MSDE. The
I'm in the process of developing an application that uses client side code (js
I have a web application that uses both localstorage but also server side SQL
I have a Silverlight application on the client communicating with the server side through
I have some client side code that uploads an Outlook email to a document
Can you have custom client-side javascript Validation for standard ASP.NET Web Form Validators? For
I know that the asp.net repeater doesnt have a Client side object model, and

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.