Beispiel #1
0
        static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
        {
            using (FileRecordSequence record = new FileRecordSequence("application.log", FileAccess.Write))
            {

                string message = string.Format("[{0}]Message::{1} StackTrace:: {2}", DateTime.Now,
                                                                                    e.Exception.Message,
                                                                                    e.Exception.StackTrace);

                record.Append(CreateData(message), SequenceNumber.Invalid,
                                                    SequenceNumber.Invalid,
                                                    RecordAppendOptions.ForceFlush);
            }
        }
Beispiel #2
0
 internal bool IsMyCollection(FileRecordSequence sequence)
 {
     return(this.sequence == sequence);
 }
Beispiel #3
0
 internal FileReservationCollection(FileRecordSequence sequence)
 {
     this.sequence = sequence;
 }
Beispiel #4
0
 public Logger()
 {
     string fileName = Properties.Settings.Default.LogFilePath;
     logger = new FileRecordSequence(fileName, FileAccess.ReadWrite);
 }
 internal bool IsMyCollection(FileRecordSequence sequence)
 {
     return this.sequence == sequence;
 }
 internal FileReservationCollection(FileRecordSequence sequence) 
 {
     this.sequence = sequence;
 }
        public LogUseSample()
		{
            // 创建一个 单一日志文件的记录序列。
			sequence = new FileRecordSequence(logName, FileAccess.ReadWrite);
		}