Last post Aug 21, 2014 04:56 AM by Shawn - MSFT
Aug 14, 2014 09:56 AM|can_thing_beat_hulk|LINK
Currently, my web service does not have any kind of "trace listener" code in it, I'm activating the trace log file from the web.config only as described in this link:
The problem with using the statically defined log file in the web.config is that it could get pretty huge and I may need to do tracing for several days. How can I have a "dynamic" log file where it either creates a new log file when the current one reaches
a certain size OR have it create a new one at specific time intervals, e.g. 12:00PM & 12:00 AM?
One of the items that I have a question on is if this has to be accomplished in code, does that mean that I need to remove all the "trace listener" xml from the web.config or is it a combination of using code in the program and part of it being done in the
Aug 21, 2014 04:56 AM|Shawn - MSFT|LINK
A common scenario for production services is to have services that are available for long periods of time and to have trace logging enabled at a low level. These services consume a lot of disk space. When troubleshooting a service, the most recent data in
the trace log is relevant to solving a problem.
The concept behind the implementation of the Circular Buffer Trace Listener is to have two files that can each store up to half of the total desired trace log data. The listener creates one file and writes to that file until it reaches the limit of half
of the data size, at which point it switches to a second file. When the listener reaches the limit for the second file - it overwrites the first file with new traces.
This listener derives from the XmlWriteTraceListener and allows the logs to be viewed with the
Service Trace Viewer Tool (SvcTraceViewer.exe). When attempting to view the logs, the two log files can be easily recombined by opening both of the log files at the same time in
the Service Trace Viewer tool. The Service Trace Viewer tool automatically takes care of sorting the traces so that they appear in the correct order.
For more inforamtion: