I'm using .NET's built-in Tracing mechanism to trace program execution. The problem is the trace file can grow to several MB very quickly. Is there an efficient way of truncating the file when it grows past a certain point? I thought of putting in a check whenever something gets written (I have a custom class that inherits from TraceListener) but that might degrade performance too much. Maybe a Timer would be a better solution?
Anyone have any ideas?