Я пишу действия, выполняемые программой в С#, в файл с помощью функции Trace.Writeln(). Но файл становится слишком большим. Как обрезать этот файл, когда он вырастет до 1 МБ?
TextWriterTraceListener traceListener = new TextWriterTraceListener(File.AppendText("audit.txt"));
Trace.Listeners.Add(traceListener);
Trace.AutoFlush = true;
Что нужно добавить к вышеуказанному блоку