摘要:
1、首先引用Log4Net 的命名空间 using log4net;2、在使用的类中生命静态变量 log public class FileService { static readonly ILog log = LogManager.GetLogger(typeof(FileService)); ..... ..... 3、在 try catch 语句中记录异常信息try { operationHandler(fileName); return FileOperationResult.Successful; } catch (IOException ex) {... 阅读全文