public void DiskSpaceTest3()
 {
     using (FileLogTraceListener log = new FileLogTraceListener()) {
         log.Location    = LogFileLocation.TempDirectory;
         log.MaxFileSize = 1000;
         log.DiskSpaceExhaustedBehavior = DiskSpaceExhaustedOption.ThrowException;
         log.Write(new string('z', 1001));
     }
 }
Beispiel #2
0
        public void Write()
        {
            var cache    = new TraceEventCache();
            var listener = new FileLogTraceListener();

            listener.Location       = LogFileLocation.Custom;
            listener.CustomLocation = GetTestFilePath();

            listener.Write("Write");
            listener.WriteLine("WriteLine");
            listener.TraceEvent(eventCache: cache, source: "Source", eventType: TraceEventType.Warning, id: 3, message: "TraceEvent");
            listener.TraceData(eventCache: cache, source: "Source", eventType: TraceEventType.Error, id: 4, data: "TraceData");
            listener.Flush();
            listener.Close();
        }
 public void DiskSpaceTest3()
 {
     using (FileLogTraceListener log = new FileLogTraceListener ()) {
         log.Location = LogFileLocation.TempDirectory;
         log.MaxFileSize = 1000;
         log.DiskSpaceExhaustedBehavior = DiskSpaceExhaustedOption.ThrowException;
         log.Write (new string('z', 1001));
     }
 }