c# 简单日志记录

FileStream fs = new FileStream(System.AppDomain.CurrentDomain.BaseDirectory + "log.txt",FileMode.Append);
                byte[] data1 = System.Text.Encoding.Default.GetBytes(eeee.Message);
                byte[] data2 = System.Text.Encoding.Default.GetBytes(eeee.StackTrace);
                fs.Write(data1,0,data1.Length);
                fs.Write(data2, 0, data2.Length);
                fs.Flush();
                fs.Close();

 

posted @ 2018-10-09 12:57  风影我爱罗  阅读(229)  评论(0编辑  收藏  举报