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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:40:15+00:00 2026-05-26T15:40:15+00:00

How can one add a footer to a trace listener which is defined in

  • 0

How can one add a footer to a trace listener which is defined in the app.config:

<system.diagnostics>
<switches>
  <!-- Set loglevel for diagnostic messages
  (0=none, 1=errors, 2=warnings, 3=info, 4=verbose) -->
  <add name="logLevel" value="4" />
</switches>
<trace autoflush="true" indentsize="4">
  <listeners>
    <add name="FileListener"
         type="System.Diagnostics.TextWriterTraceListener"
         initializeData="Logs\QFXLog.txt" />
    <remove name="Default" />
  </listeners>
</trace>

I want to write an end footer when this listener is closed.
What entries are to be defined in the config(if any?) and where must one define the footer string in code?

Thanks,
Juergen

  • 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-26T15:40:16+00:00Added an answer on May 26, 2026 at 3:40 pm

    I don’t know of any way to handle this directly in the app.config file, but you could implement a class which inherits TextWriterTraceListener and then override its Close method:

    namespace MyNamespace
    {
        public class FormattedTextTracer : TextWriterTraceListener
        {
            public override void Close()
            {
                 // Write footer
                 Writer.WriteLine("==== Footer ====");
                 Writer.Flush();
                 base.Close();
            }
        }
    }
    

    And in the app.config file, replace the listener type with your class:

    <listeners>
        <add name="FileListener"
         type="MyNamespace.FormattedTextTracer, MyNamespace"
         initializeData="Logs\QFXLog.txt" />
        <remove name="Default" />
    </listeners>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know one can add event listener for window.error. However when working with Iframes,
I have two buttons which i add it in one in table-footer and other
How can one add two long values in Java so that if the result
I would like to create a list of records. I can add one record
Can I add multiple values in one key in isolated storage settings? How?
How can I add a drop shadow effect to a website that has one
Edited to Add * I haven't found a solution for this one yet, can
How can one add a slider control object in Excel Interop using Visual Studio
How one can add a menubar to a wx.grid frame? I have searched a
How can one add the number of powers of x in expressions like the

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.