How can we add a a daily trace listener

Discussion in 'ASP .Net' started by ShayHk, Dec 23, 2013.

  1. ShayHk

    ShayHk Guest

    i add on the web.config
    <configuration>
    <system.diagnostics>
    <trace autoflush="false" indentsize="4">
    <listeners>
    <add name="myListener"
    type="System.Diagnostics.TextWriterTraceListener"
    initializeData="aaa.log" />
    <remove name="Default" />
    </listeners>
    </trace>
    </system.diagnostics>
    </configuration>

    i want it to be a daily file trace
    aaa_20130101.txt
    aaa_20130102.txt
    .....

    how can i do it?
     
    ShayHk, Dec 23, 2013
    #1
    1. Advertisements

  2. ShayHk

    Arne Vajhøj Guest

    Maybe it is time to drop trace and switch to a real logging
    framework - they come with features like this.

    Example: log4net has RollingFileAppender for this.

    Arne
     
    Arne Vajhøj, Dec 25, 2013
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.