📜  log4net 以编程方式获取日志文件路径 - 无论代码示例

📅  最后修改于: 2022-03-11 14:56:07.142000             🧑  作者: Mango

代码示例1
var rootAppender = ((Hierarchy)LogManager.GetRepository())
                                         .Root.Appenders.OfType()
                                         .FirstOrDefault();

string filename = rootAppender != null ? rootAppender.File : string.Empty;