Log4Net試用

1 添加參考

2 新增Log4Net.config,放在Bin\Debug

3 Form1.vb添加ReadOnly logger As ILog = LogManager.GetLogger(GetType(Form1))

4 AssemblyInfo.vb添加<Assembly: log4net.Config.XmlConfigurator(ConfigFile:="Log4Net.config", Watch:=True)>

5 logger.Debug("divide err", ex)

原文地址:https://www.cnblogs.com/htht66/p/1796728.html