Skip to content

Commit af30c21

Browse files
committed
Some cleanup to the log4net appender.
1 parent fc9b3ab commit af30c21

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Source/Platforms/Log4net/ExceptionlessAppender.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@ public class ExceptionlessAppender : AppenderSkeleton {
1010
public string ServerUrl { get; set; }
1111

1212
public override void ActivateOptions() {
13-
if (!String.IsNullOrEmpty(ApiKey) || !String.IsNullOrEmpty(ServerUrl))
14-
_client = new ExceptionlessClient(config => {
15-
if (!String.IsNullOrEmpty(ApiKey))
16-
config.ApiKey = ApiKey;
17-
if (!String.IsNullOrEmpty(ServerUrl))
18-
config.ServerUrl = ServerUrl;
19-
config.UseInMemoryStorage();
20-
});
13+
if (String.IsNullOrEmpty(ApiKey) && String.IsNullOrEmpty(ServerUrl))
14+
return;
15+
16+
_client = new ExceptionlessClient(config => {
17+
if (!String.IsNullOrEmpty(ApiKey))
18+
config.ApiKey = ApiKey;
19+
if (!String.IsNullOrEmpty(ServerUrl))
20+
config.ServerUrl = ServerUrl;
21+
config.UseInMemoryStorage();
22+
});
2123
}
2224

2325
protected override void Append(LoggingEvent loggingEvent) {

0 commit comments

Comments
 (0)