From ba52a050eea639d6115ac3ddc8b98cd9ae7b4e0b Mon Sep 17 00:00:00 2001 From: Emrys <9097206@qq.com> Date: Thu, 13 Apr 2017 10:36:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Emrys.FlashLog/FlashLogger.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Emrys.FlashLog/FlashLogger.cs b/Emrys.FlashLog/FlashLogger.cs index ee24b7e..84e6d9e 100644 --- a/Emrys.FlashLog/FlashLogger.cs +++ b/Emrys.FlashLog/FlashLogger.cs @@ -36,8 +36,14 @@ namespace Emrys.FlashLog private FlashLogger() { + var configFile = new FileInfo(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log4net.config")); + if (!configFile.Exists) + { + throw new Exception("未配置log4net配置文件!"); + } + // 设置日志配置文件路径 - XmlConfigurator.Configure(new FileInfo(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log4net.config"))); + XmlConfigurator.Configure(configFile); _que = new ConcurrentQueue(); _mre = new ManualResetEvent(false);