系统服务中如何将信息写入到日志中

 /*****************输出信息到日志文件*********************/
            using (System.IO.StreamWriter sw = new System.IO.StreamWriter(AppDomain.CurrentDomain.BaseDirectory + "log.txt", true))
            {
                sw.WriteLine("**************************************************************");
                sw.WriteLine("服务启动时间:" + System.DateTime.Now.ToString() + "");
            }
原文地址:https://www.cnblogs.com/camelroyu/p/4140144.html