How can we add a a daily trace listener

  • Thread starter Thread starter ShayHk
  • Start date Start date
S

ShayHk

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?
 
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?

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
 
Back
Top