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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:32:34+00:00 2026-05-24T10:32:34+00:00

We use the logging application block in our ASP.NET 2.0 application which is called

  • 0

We use the logging application block in our ASP.NET 2.0 application which is called in the following way:

public class BaseLogEntry : LogEntry
{
    public void CloseLog()
    {
        try
        {
            Logger.Writer.Dispose();
        }
        catch (Exception)
        { }
    }
}

public class GeneralLogEntry : BaseLogEntry
{
    /// <summary>
    /// 
    /// </summary>
    /// <param name="message"></param>
    public GeneralLogEntry(string message) : this(message, 2) { }

    /// <summary>
    /// 
    /// </summary>
    /// <param name="message"></param>
    /// <param name="priority"></param>
    public GeneralLogEntry(string message, int priority): base()
    {
        Categories.Add("General");
        Priority = priority;
        Severity = System.Diagnostics.TraceEventType.Information;
        Message = message;
        CloseLog();
    }
}

When we increase the number of worker processes in IIS above 1 the log files are prepended with a unique GUID like this:

068aa49c-2bf6-4278-8f91-c6b65fd1ea3aApplication.log

There are several log files generated by the app all of type “Rolling Flat File Trace Listener”

Is there a way to avoid this?

  • 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-24T10:32:35+00:00Added an answer on May 24, 2026 at 10:32 am

    Originally from: http://ykm001.springnote.com/pages/6348311?print=1 (now a dead link redirecting to a game site):

    Known problems

    A GUID might be prepended to the filename of the log file
    A RollingFileTraceListener instance “owns” the log file it is writing to and
    locks it for exclusive write access when it writes the first log entry. It
    keeps the file locked until the instance is disposed. If another
    RollingFileTraceListener instance is created that points to the same file,
    before the first instance is disposed, the second instance cannot open this
    file for writing and will write to a new file with a GUID prepended to its
    name.

    The RollingFileTraceListener indirectly derives from
    System.Diagnostics.TextWriterTraceListener. This class changes the filename to
    include a GUID when the file with the specified filename cannot be written to.
    This is because RollingFileTraceListener indirectly calls the EnsureWriter
    method on its base class TextWriterTraceListener. .NET Reflector shows this
    code for System.Diagnostics.TextWriterTraceListener.EnsureWriter() in
    System.dll (slightly rewritten to improve clarity):

    try
    {
        this.writer = new StreamWriter(fileNameWithPath, true, encoding1, 0x1000);
        break;
    }
    catch (IOException)
    {
        Guid guid1 = Guid.NewGuid();
        fileName = guid1.ToString() + fileName;
        fileNameWithPath = Path.Combine(folderPath, fileName );
    }
    

    Basically it seems to be a known problem, there is a workaround at

    http://entlibcontrib.codeplex.com/workitem/7472

    Using the NoGUIDRollingFlatFileListener doesn’t help, the problem still occurs (even after much time spent recompiling the logging application block). It might well be fixable in EntLib 4 but I’m stuck with Ent Lib 3.1

    Perhaps I should look at alternative logging mechanisms

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

Sidebar

Related Questions

We're using ELMAH for error logging in our ASP.NET application. We use the SQL
I'm modifying an existing winforms application to use the Logging Application Block. For historical
I have a grasp on this application block with ASP.NET, but I feel unsure
I use library which uses sfl4j-api for logging in android application. So I use
I have an ASP.NET 3.5 SP1 Webforms Application. I use the MVP pattern (supervising
I am developing a java application for which i have to use a logging
I'm planning to use DotNetOpenAuth(http://www.dotnetopenauth.net/) for implementing openid logging for my application. Initially I
I am trying to use Microsoft.VisualBasic.Logging.FileLogTraceListener in my ASP.NET MVC 3 app (vb.net). It
I have an application which use java.util logging and libraries used by this application
In the application that I am working on, the logging facility makes use of

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.