How can we add a a daily trace listener

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

Arne Vajhøj

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
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Top