From af30c21969220318e2bb183e0436d31bcb1719d4 Mon Sep 17 00:00:00 2001 From: Blake Niemyjski Date: Thu, 2 Apr 2015 12:16:50 -0500 Subject: [PATCH] Some cleanup to the log4net appender. --- .../Platforms/Log4net/ExceptionlessAppender.cs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Source/Platforms/Log4net/ExceptionlessAppender.cs b/Source/Platforms/Log4net/ExceptionlessAppender.cs index dc7f97bf..ab1d2624 100644 --- a/Source/Platforms/Log4net/ExceptionlessAppender.cs +++ b/Source/Platforms/Log4net/ExceptionlessAppender.cs @@ -10,14 +10,16 @@ public class ExceptionlessAppender : AppenderSkeleton { public string ServerUrl { get; set; } public override void ActivateOptions() { - if (!String.IsNullOrEmpty(ApiKey) || !String.IsNullOrEmpty(ServerUrl)) - _client = new ExceptionlessClient(config => { - if (!String.IsNullOrEmpty(ApiKey)) - config.ApiKey = ApiKey; - if (!String.IsNullOrEmpty(ServerUrl)) - config.ServerUrl = ServerUrl; - config.UseInMemoryStorage(); - }); + if (String.IsNullOrEmpty(ApiKey) && String.IsNullOrEmpty(ServerUrl)) + return; + + _client = new ExceptionlessClient(config => { + if (!String.IsNullOrEmpty(ApiKey)) + config.ApiKey = ApiKey; + if (!String.IsNullOrEmpty(ServerUrl)) + config.ServerUrl = ServerUrl; + config.UseInMemoryStorage(); + }); } protected override void Append(LoggingEvent loggingEvent) {