diff --git a/src/Agent/NewRelic/Agent/Core/Agent.cs b/src/Agent/NewRelic/Agent/Core/Agent.cs index 8ec82f9cd9..b6c2348bbe 100644 --- a/src/Agent/NewRelic/Agent/Core/Agent.cs +++ b/src/Agent/NewRelic/Agent/Core/Agent.cs @@ -410,17 +410,17 @@ public void RecordLogMessage(string frameworkName, object logEvent, Func /// The log level. /// - public string Level { get; } + public string LogLevel { get; } /// /// The span id of the segment. @@ -52,20 +52,20 @@ public float Priority } } - public LogEventWireModel(long unixTimestampMS, string message, string level, string spanId, string traceId) + public LogEventWireModel(long unixTimestampMS, string message, string logLevel, string spanId, string traceId) { TimeStamp = unixTimestampMS; Message = message.TruncateUnicodeStringByBytes(MaxMessageLengthInBytes); - Level = level; + LogLevel = logLevel; SpanId = spanId; TraceId = traceId; } - public LogEventWireModel(long unixTimestampMS, string message, string level, string spanId, string traceId, float priority) + public LogEventWireModel(long unixTimestampMS, string message, string logLevel, string spanId, string traceId, float priority) { TimeStamp = unixTimestampMS; Message = message.TruncateUnicodeStringByBytes(MaxMessageLengthInBytes); - Level = level; + LogLevel = logLevel; SpanId = spanId; TraceId = traceId; Priority = priority; diff --git a/tests/Agent/IntegrationTests/IntegrationTestHelpers/Assertions.cs b/tests/Agent/IntegrationTests/IntegrationTestHelpers/Assertions.cs index 48d63d6104..3f8cd74476 100644 --- a/tests/Agent/IntegrationTests/IntegrationTestHelpers/Assertions.cs +++ b/tests/Agent/IntegrationTests/IntegrationTestHelpers/Assertions.cs @@ -598,7 +598,7 @@ private static LogLine TryFindLogLine(ExpectedLogLine expectedLogLine, IEnumerab { foreach (var actualLogLine in actualLogLines) { - if (expectedLogLine.LogLevel != actualLogLine.Level) + if (expectedLogLine.LogLevel != actualLogLine.LogLevel) continue; if (expectedLogLine.LogMessage != actualLogLine.Message) continue; diff --git a/tests/Agent/IntegrationTests/IntegrationTestHelpers/Models/LogData.cs b/tests/Agent/IntegrationTests/IntegrationTestHelpers/Models/LogData.cs index a8812194e6..ebed2b3846 100644 --- a/tests/Agent/IntegrationTests/IntegrationTestHelpers/Models/LogData.cs +++ b/tests/Agent/IntegrationTests/IntegrationTestHelpers/Models/LogData.cs @@ -57,8 +57,8 @@ public class LogLine [JsonProperty("message")] public string Message { get; set; } - [JsonProperty("level")] - public string Level { get; set; } + [JsonProperty("log.level")] + public string LogLevel { get; set; } [JsonProperty("attributes")] public LogAttributes Attributes { get; set; } diff --git a/tests/Agent/IntegrationTests/IntegrationTests/Logging/MaxSamplesStoredTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/Logging/MaxSamplesStoredTests.cs index 701a7f1038..a0717a3b3c 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/Logging/MaxSamplesStoredTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/Logging/MaxSamplesStoredTests.cs @@ -62,7 +62,7 @@ public void OnlyOneLogLineIsSent() Assert.Single(logData.Logs); var logLine = logData.Logs[0]; Assert.False(string.IsNullOrWhiteSpace(logLine.Message)); - Assert.False(string.IsNullOrWhiteSpace(logLine.Level)); + Assert.False(string.IsNullOrWhiteSpace(logLine.LogLevel)); Assert.NotEqual(0, logLine.Timestamp); } diff --git a/tests/Agent/IntegrationTests/IntegrationTests/Logging/MetricsAndForwardingTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/Logging/MetricsAndForwardingTests.cs index 3e92354308..f0d5f03d8a 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/Logging/MetricsAndForwardingTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/Logging/MetricsAndForwardingTests.cs @@ -230,7 +230,7 @@ public void CountsAndValuesAreAsExpected() foreach (var logLine in logLines) { Assert.False(string.IsNullOrWhiteSpace(logLine.Message)); - Assert.False(string.IsNullOrWhiteSpace(logLine.Level)); + Assert.False(string.IsNullOrWhiteSpace(logLine.LogLevel)); Assert.NotEqual(0, logLine.Timestamp); } } diff --git a/tests/Agent/UnitTests/Core.UnitTest/JsonConverters/LogEventWireModelCollectionJsonConverterTests.cs b/tests/Agent/UnitTests/Core.UnitTest/JsonConverters/LogEventWireModelCollectionJsonConverterTests.cs index ef687bfa33..97073bd316 100644 --- a/tests/Agent/UnitTests/Core.UnitTest/JsonConverters/LogEventWireModelCollectionJsonConverterTests.cs +++ b/tests/Agent/UnitTests/Core.UnitTest/JsonConverters/LogEventWireModelCollectionJsonConverterTests.cs @@ -20,7 +20,7 @@ public void LogEventWireModelCollectionIsJsonSerializable() "hostname", new List() { - new LogEventWireModel(1, "message", "level", "spanId", "traceId") + new LogEventWireModel(1, "message", "log.level", "spanId", "traceId") { Priority = 33.3f } @@ -30,7 +30,7 @@ public void LogEventWireModelCollectionIsJsonSerializable() Assert.AreEqual( "{\"common\":{\"attributes\":{\"entity.name\":\"myApplicationName\",\"entity.guid\":\"guid\",\"hostname\":\"hostname\"}}," + - "\"logs\":[{\"timestamp\":1,\"message\":\"message\",\"level\":\"level\"," + + "\"logs\":[{\"timestamp\":1,\"message\":\"message\",\"log.level\":\"log.level\"," + "\"attributes\":{\"span.id\":\"spanId\",\"trace.id\":\"traceId\"}}]}", serialized); } diff --git a/tests/Agent/UnitTests/Core.UnitTest/WireModels/LogEventWireModelCollectionTests.cs b/tests/Agent/UnitTests/Core.UnitTest/WireModels/LogEventWireModelCollectionTests.cs index 35a4b0036c..5df9c9e097 100644 --- a/tests/Agent/UnitTests/Core.UnitTest/WireModels/LogEventWireModelCollectionTests.cs +++ b/tests/Agent/UnitTests/Core.UnitTest/WireModels/LogEventWireModelCollectionTests.cs @@ -33,7 +33,7 @@ public void ConstructorTest() var loggingEvent = objectUnderTest.LoggingEvents[0]; Assert.AreEqual(1, loggingEvent.TimeStamp); Assert.AreEqual("TestMessage", loggingEvent.Message); - Assert.AreEqual("TestLevel", loggingEvent.Level); + Assert.AreEqual("TestLevel", loggingEvent.LogLevel); Assert.AreEqual("TestSpanId", loggingEvent.SpanId); Assert.AreEqual("TestTraceId", loggingEvent.TraceId); } diff --git a/tests/Agent/UnitTests/Core.UnitTest/WireModels/LogEventWireModelTests.cs b/tests/Agent/UnitTests/Core.UnitTest/WireModels/LogEventWireModelTests.cs index 3db89fc855..d3394a474d 100644 --- a/tests/Agent/UnitTests/Core.UnitTest/WireModels/LogEventWireModelTests.cs +++ b/tests/Agent/UnitTests/Core.UnitTest/WireModels/LogEventWireModelTests.cs @@ -18,17 +18,17 @@ public void ConstructorTest() { var expectedTimestamp = 1234L; var expectedMessage = "Log Message FTW!"; - var expectedLevel = "TestLogLevel"; + var expectedLogLevel = "TestLogLevel"; var expectedSpanId = "TestSpanId"; var expectedTraceId = "ExpectedTraceId"; float expectedPriority = 0; - var objectUnderTest = new LogEventWireModel(expectedTimestamp, expectedMessage, expectedLevel, expectedSpanId, expectedTraceId); + var objectUnderTest = new LogEventWireModel(expectedTimestamp, expectedMessage, expectedLogLevel, expectedSpanId, expectedTraceId); Assert.NotNull(objectUnderTest); Assert.AreEqual(expectedTimestamp, objectUnderTest.TimeStamp); Assert.AreEqual(expectedMessage, objectUnderTest.Message); - Assert.AreEqual(expectedLevel, objectUnderTest.Level); + Assert.AreEqual(expectedLogLevel, objectUnderTest.LogLevel); Assert.AreEqual(expectedSpanId, objectUnderTest.SpanId); Assert.AreEqual(expectedTraceId, objectUnderTest.TraceId); Assert.AreEqual(expectedPriority, objectUnderTest.Priority); diff --git a/tests/Agent/UnitTests/Core.UnitTest/Wrapper/AgentWrapperApi/AgentWrapperApiTests.cs b/tests/Agent/UnitTests/Core.UnitTest/Wrapper/AgentWrapperApi/AgentWrapperApiTests.cs index 8ad60d385b..779f00de9d 100644 --- a/tests/Agent/UnitTests/Core.UnitTest/Wrapper/AgentWrapperApi/AgentWrapperApiTests.cs +++ b/tests/Agent/UnitTests/Core.UnitTest/Wrapper/AgentWrapperApi/AgentWrapperApiTests.cs @@ -1348,7 +1348,7 @@ public void RecordLogMessage_NoTransaction_Success() Assert.AreEqual(1, logEvents.Count); Assert.IsNotNull(logEvent); Assert.AreEqual(timestampUnix, logEvent.TimeStamp); - Assert.AreEqual(level, logEvent.Level); + Assert.AreEqual(level, logEvent.LogLevel); Assert.AreEqual(message, logEvent.Message); Assert.AreEqual(spanId, logEvent.SpanId); Assert.AreEqual(traceId, logEvent.TraceId); @@ -1385,7 +1385,7 @@ public void RecordLogMessage_WithTransaction_Success() Assert.AreEqual(1, transaction.LogEvents.Count); Assert.IsNotNull(logEvent); Assert.AreEqual(timestampUnix, logEvent.TimeStamp); - Assert.AreEqual(level, logEvent.Level); + Assert.AreEqual(level, logEvent.LogLevel); Assert.AreEqual(message, logEvent.Message); Assert.AreEqual(spanId, logEvent.SpanId); Assert.AreEqual(traceId, logEvent.TraceId);