http://stackoverflow.com/questions/1343749/get-log4net-log-file-in-c-sharp
Solution is quite easy in your situation; just use this code:
var rootAppender = ((Hierarchy)LogManager.GetRepository()) .Root.Appenders.OfType<FileAppender>() .FirstOrDefault(); string filename = rootAppender != null ? rootAppender.File : string.Empty;
通过vs的监视器查看
((log4net.Appender.FileAppender)((log4net.Appender.IAppender[])((log4net.Appender.AppenderCollection.ReadOnlyAppenderCollection)((Triton.Common.LogUtilities.AsyncAppender)((log4net.Appender.IAppender[])((log4net.Appender.AppenderCollection.ReadOnlyAppenderCollection)((log4net.Repository.Hierarchy.Logger)((log4net.Core.LoggerWrapperImpl)Log).Logger).Hierarchy.Root.Appenders).SyncRoot)[0]).Appenders).SyncRoot)[0]).File
((log4net.Appender.FileAppender)(new System.Linq.SystemCore_EnumerableDebugView(((log4net.Repository.Hierarchy.Hierarchy)((log4net.Repository.Hierarchy.Logger)((log4net.Core.LoggerWrapperImpl)Logger).Logger).Repository).Root.Appenders).Items[0])).File