Skip to content

Commit 781b961

Browse files
committed
Updated log levels for various log messages
1 parent 490ec6b commit 781b961

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

src/Exceptionless/Plugins/Default/080_VersionPlugin.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ private string GetVersionFromRuntimeInfo(IExceptionlessLog log) {
4242
var platformService = Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default;
4343
return platformService.Application.ApplicationVersion;
4444
} catch (Exception ex) {
45-
log.FormattedInfo(typeof(VersionPlugin), "Unable to get Platform Services instance. Error: {0}", ex.Message);
45+
log.FormattedError(typeof(VersionPlugin), ex, "Unable to get Platform Services instance. Error: {0}", ex.Message);
4646
}
4747
#endif
4848
return null;
@@ -69,7 +69,7 @@ private string GetVersionFromLoadedAssemblies(IExceptionlessLog log) {
6969
return version;
7070
}
7171
} catch (Exception ex) {
72-
log.FormattedInfo(typeof(VersionPlugin), "Unable to get version from loaded assemblies. Error: {0}", ex.Message);
72+
log.FormattedError(typeof(VersionPlugin), ex, "Unable to get version from loaded assemblies. Error: {0}", ex.Message);
7373
}
7474

7575
return null;

src/Exceptionless/Plugins/Default/1010_DuplicateCheckerPlugin.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ public void Run(EventPluginContext context) {
4747

4848
DateTimeOffset repeatWindow = DateTimeOffset.UtcNow.Subtract(_interval);
4949
if (_processed.Any(s => s.Item1 == hashCode && s.Item2 >= repeatWindow)) {
50-
context.Log.FormattedInfo(typeof(DuplicateCheckerPlugin), "Adding event with hash: {0} to cache.", hashCode);
50+
context.Log.FormattedTrace(typeof(DuplicateCheckerPlugin), "Adding event with hash: {0} to cache.", hashCode);
5151
// This event is a duplicate for the first time, lets save it so we can delay it while keeping count
5252
_mergedEvents.Enqueue(new MergedEvent(hashCode, context, count));
5353
context.Cancel = true;
5454
return;
5555
}
5656

57-
context.Log.FormattedInfo(typeof(DuplicateCheckerPlugin), "Enqueueing event with hash: {0} to cache.", hashCode);
57+
context.Log.FormattedTrace(typeof(DuplicateCheckerPlugin), "Enqueueing event with hash: {0} to cache.", hashCode);
5858
_processed.Enqueue(Tuple.Create(hashCode, DateTimeOffset.UtcNow));
5959

6060
while (_processed.Count > 50)

src/Exceptionless/Queue/DefaultEventQueue.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ public void Process() {
8282
deleteBatch = false;
8383
} else if (response.PaymentRequired) {
8484
// If the organization over the rate limit then discard the event.
85-
_log.Info(typeof(DefaultEventQueue), "Too many events have been submitted, please upgrade your plan.");
85+
_log.Warn(typeof(DefaultEventQueue), "Too many events have been submitted, please upgrade your plan.");
8686
SuspendProcessing(discardFutureQueuedItems: true, clearQueue: true);
8787
} else if (response.UnableToAuthenticate) {
8888
// The api key was suspended or could not be authorized.
89-
_log.Info(typeof(DefaultEventQueue), "Unable to authenticate, please check your configuration. The event will not be submitted.");
89+
_log.Error(typeof(DefaultEventQueue), "Unable to authenticate, please check your configuration. The event will not be submitted.");
9090
SuspendProcessing(TimeSpan.FromMinutes(15));
9191
} else if (response.NotFound || response.BadRequest) {
9292
// The service end point could not be found.

src/Exceptionless/Services/DefaultEnvironmentInfoCollector.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ private void PopulateApplicationInfo(EnvironmentInfo info) {
4343
try {
4444
info.Data.Add("AppDomainName", AppDomain.CurrentDomain.FriendlyName);
4545
} catch (Exception ex) {
46-
_log.FormattedInfo(typeof(DefaultEnvironmentInfoCollector), "Unable to get AppDomain friendly name. Error message: {0}", ex.Message);
46+
_log.FormattedError(typeof(DefaultEnvironmentInfoCollector), ex, "Unable to get AppDomain friendly name. Error message: {0}", ex.Message);
4747
}
4848
#endif
4949

@@ -53,7 +53,7 @@ private void PopulateApplicationInfo(EnvironmentInfo info) {
5353
if (hostEntry != null && hostEntry.AddressList.Any())
5454
info.IpAddress = String.Join(", ", hostEntry.AddressList.Where(x => x.AddressFamily == AddressFamily.InterNetwork).Select(a => a.ToString()).ToArray());
5555
} catch (Exception ex) {
56-
_log.FormattedInfo(typeof(DefaultEnvironmentInfoCollector), "Unable to get ip address. Error message: {0}", ex.Message);
56+
_log.FormattedError(typeof(DefaultEnvironmentInfoCollector), ex, "Unable to get ip address. Error message: {0}", ex.Message);
5757
}
5858
#endif
5959
}
@@ -62,7 +62,7 @@ private void PopulateProcessInfo(EnvironmentInfo info) {
6262
try {
6363
info.ProcessorCount = Environment.ProcessorCount;
6464
} catch (Exception ex) {
65-
_log.FormattedInfo(typeof(DefaultEnvironmentInfoCollector), "Unable to get processor count. Error message: {0}", ex.Message);
65+
_log.FormattedError(typeof(DefaultEnvironmentInfoCollector), ex, "Unable to get processor count. Error message: {0}", ex.Message);
6666
}
6767

6868
#if !PORTABLE && !NETSTANDARD1_2
@@ -71,7 +71,7 @@ private void PopulateProcessInfo(EnvironmentInfo info) {
7171
info.ProcessName = process.ProcessName;
7272
info.ProcessId = process.Id.ToString(NumberFormatInfo.InvariantInfo);
7373
} catch (Exception ex) {
74-
_log.FormattedInfo(typeof(DefaultEnvironmentInfoCollector), "Unable to get process name or id. Error message: {0}", ex.Message);
74+
_log.FormattedError(typeof(DefaultEnvironmentInfoCollector), ex, "Unable to get process name or id. Error message: {0}", ex.Message);
7575
}
7676

7777
try {
@@ -81,7 +81,7 @@ private void PopulateProcessInfo(EnvironmentInfo info) {
8181
info.CommandLine = Environment.CommandLine;
8282
#endif
8383
} catch (Exception ex) {
84-
_log.FormattedInfo(typeof(DefaultEnvironmentInfoCollector), "Unable to get command line. Error message: {0}", ex.Message);
84+
_log.FormattedError(typeof(DefaultEnvironmentInfoCollector), ex, "Unable to get command line. Error message: {0}", ex.Message);
8585
}
8686
#endif
8787
}
@@ -91,13 +91,13 @@ private void PopulateThreadInfo(EnvironmentInfo info) {
9191
try {
9292
info.ThreadId = Thread.CurrentThread.ManagedThreadId.ToString(NumberFormatInfo.InvariantInfo);
9393
} catch (Exception ex) {
94-
_log.FormattedInfo(typeof(DefaultEnvironmentInfoCollector), "Unable to get thread id. Error message: {0}", ex.Message);
94+
_log.FormattedError(typeof(DefaultEnvironmentInfoCollector), ex, "Unable to get thread id. Error message: {0}", ex.Message);
9595
}
9696

9797
try {
9898
info.ThreadName = Thread.CurrentThread.Name;
9999
} catch (Exception ex) {
100-
_log.FormattedInfo(typeof(DefaultEnvironmentInfoCollector), "Unable to get current thread name. Error message: {0}", ex.Message);
100+
_log.FormattedError(typeof(DefaultEnvironmentInfoCollector), ex, "Unable to get current thread name. Error message: {0}", ex.Message);
101101
}
102102
#endif
103103
}
@@ -108,7 +108,7 @@ private void PopulateMemoryInfo(EnvironmentInfo info) {
108108
Process process = Process.GetCurrentProcess();
109109
info.ProcessMemorySize = process.PrivateMemorySize64;
110110
} catch (Exception ex) {
111-
_log.FormattedInfo(typeof(DefaultEnvironmentInfoCollector), "Unable to get process memory size. Error message: {0}", ex.Message);
111+
_log.FormattedError(typeof(DefaultEnvironmentInfoCollector), ex, "Unable to get process memory size. Error message: {0}", ex.Message);
112112
}
113113
#endif
114114

@@ -128,7 +128,7 @@ private void PopulateMemoryInfo(EnvironmentInfo info) {
128128
info.AvailablePhysicalMemory = Convert.ToInt64(computerInfo.AvailablePhysicalMemory);
129129
}
130130
} catch (Exception ex) {
131-
_log.FormattedInfo(typeof(DefaultEnvironmentInfoCollector), "Unable to get physical memory. Error message: {0}", ex.Message);
131+
_log.FormattedError(typeof(DefaultEnvironmentInfoCollector), ex, "Unable to get physical memory. Error message: {0}", ex.Message);
132132
}
133133
#endif
134134
}
@@ -164,7 +164,7 @@ private void PopulateRuntimeInfo(EnvironmentInfo info) {
164164
info.MachineName = Guid.NewGuid().ToString("N");
165165
#endif
166166
} catch (Exception ex) {
167-
_log.FormattedInfo(typeof(DefaultEnvironmentInfoCollector), "Unable to get machine name. Error message: {0}", ex.Message);
167+
_log.FormattedError(typeof(DefaultEnvironmentInfoCollector), ex, "Unable to get machine name. Error message: {0}", ex.Message);
168168
}
169169

170170
#if !PORTABLE && !NETSTANDARD1_2
@@ -181,7 +181,7 @@ private void PopulateRuntimeInfo(EnvironmentInfo info) {
181181
computerInfo = new Microsoft.VisualBasic.Devices.ComputerInfo();
182182
#endif
183183
} catch (Exception ex) {
184-
_log.FormattedInfo(typeof(DefaultEnvironmentInfoCollector), "Unable to get computer info. Error message: {0}", ex.Message);
184+
_log.FormattedError(typeof(DefaultEnvironmentInfoCollector), ex, "Unable to get computer info. Error message: {0}", ex.Message);
185185
}
186186

187187
#if NETSTANDARD || NET45
@@ -202,7 +202,7 @@ private void PopulateRuntimeInfo(EnvironmentInfo info) {
202202
info.RuntimeVersion = Environment.Version.ToString();
203203
#endif
204204
} catch (Exception ex) {
205-
_log.FormattedInfo(typeof(DefaultEnvironmentInfoCollector), "Unable to get populate runtime info. Error message: {0}", ex.Message);
205+
_log.FormattedError(typeof(DefaultEnvironmentInfoCollector), ex, "Unable to get populate runtime info. Error message: {0}", ex.Message);
206206
}
207207
#endif
208208
}
@@ -246,7 +246,7 @@ private bool Is64BitOperatingSystem() {
246246

247247
return ((methodExist && KernelNativeMethods.IsWow64Process(KernelNativeMethods.GetCurrentProcess(), out is64)) && is64);
248248
} catch (Exception ex) {
249-
_log.FormattedInfo(typeof(DefaultEnvironmentInfoCollector), "Unable to get CPU architecture. Error message: {0}", ex.Message);
249+
_log.FormattedError(typeof(DefaultEnvironmentInfoCollector), ex, "Unable to get CPU architecture. Error message: {0}", ex.Message);
250250
}
251251

252252
return false;

tests/Exceptionless.Tests/EventBuilderTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using Exceptionless;
33
using Xunit;
44

5-
namespace Client.Tests {
5+
namespace Exceptionless.Tests {
66
public class EventBuilderTests {
77
private ExceptionlessClient CreateClient() {
88
return new ExceptionlessClient(c => {

tests/Exceptionless.Tests/LastReferenceIdManager/DefaultLastReferenceIdManagerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using Exceptionless.Dependency;
33
using Xunit;
44

5-
namespace Pcl.Tests.Plugins {
5+
namespace Exceptionless.Tests {
66
public class DefaultLastReferenceIdManagerTests {
77
[Fact]
88
public void VerfiyGetSetAndClear() {

0 commit comments

Comments
 (0)