Skip to content

Commit

Permalink
APM Logs-in-Context Forwarding on by default (#1078)
Browse files Browse the repository at this point in the history
* APM Logs-in-Context Forwarding on by default

* Updated Forwarding default test to check for true

* Removed applicationLogging defaults where possible in integration tests
  • Loading branch information
jaffinito authored May 5, 2022
1 parent d594aa8 commit 3c61a36
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/Agent/NewRelic/Agent/Core/Config/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5063,12 +5063,12 @@ public partial class configurationApplicationLoggingForwarding
/// </summary>
public configurationApplicationLoggingForwarding()
{
this.enabledField = false;
this.enabledField = true;
this.maxSamplesStoredField = 10000;
}

[System.Xml.Serialization.XmlAttributeAttribute()]
[System.ComponentModel.DefaultValueAttribute(false)]
[System.ComponentModel.DefaultValueAttribute(true)]
public bool enabled
{
get
Expand Down
2 changes: 1 addition & 1 deletion src/Agent/NewRelic/Agent/Core/Config/Configuration.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -1615,7 +1615,7 @@
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attribute name="enabled" type="xs:boolean" default="false">
<xs:attribute name="enabled" type="xs:boolean" default="true">
<xs:annotation>
<xs:documentation>
Controls whether or not log forwarding occurs. Defaults to false.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ public HSMOrCSPDisablesForwardingTestsBase(TFixture fixture, ITestOutputHelper o
{
var configModifier = new NewRelicConfigModifier(fixture.DestinationNewRelicConfigFilePath);

// applicationLogging metrics and forwarding enabled by default
configModifier
.EnableApplicationLogging()
.EnableLogForwarding()
.EnableLogMetrics()
.EnableDistributedTrace()
.SetLogLevel("debug");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public LocalDecorationTestsBase(TFixture fixture, ITestOutputHelper output, bool
var configModifier = new NewRelicConfigModifier(fixture.DestinationNewRelicConfigFilePath);

configModifier
.EnableApplicationLogging()
.EnableLogDecoration(_decorationEnabled)
.EnableDistributedTrace()
.SetLogLevel("debug");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ public MaxSamplesStoredTestsBase(TFixture fixture, ITestOutputHelper output, Log
{
var configModifier = new NewRelicConfigModifier(fixture.DestinationNewRelicConfigFilePath);

// applicationLogging metrics and forwarding enabled by default
configModifier
.EnableApplicationLogging()
.EnableLogForwarding()
.EnableLogMetrics()
.SetLogForwardingMaxSamplesStored(12)
.EnableDistributedTrace()
.SetLogLevel("debug");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public MetricsAndForwardingTestsBase(TFixture fixture, ITestOutputHelper output,
{
var configModifier = new NewRelicConfigModifier(fixture.DestinationNewRelicConfigFilePath);

configModifier.EnableApplicationLogging()
configModifier
.EnableLogMetrics(metricsEnabled)
.EnableLogForwarding(forwardingEnabled)
.EnableDistributedTrace()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ public ZeroMaxSamplesStoredTestsBase(TFixture fixture, ITestOutputHelper output,
{
var configModifier = new NewRelicConfigModifier(fixture.DestinationNewRelicConfigFilePath);

// applicationLogging metrics and forwarding enabled by default
configModifier
.EnableApplicationLogging()
.EnableLogForwarding()
.EnableLogMetrics()
.SetLogForwardingMaxSamplesStored(1) // must be 1 since 0 causes it to return the default
.EnableDistributedTrace()
.SetLogLevel("debug");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2643,9 +2643,9 @@ public void ApplicationLogging_Enabled_OverridesIndividualLoggingFeatures(bool a
}

[Test]
public void ApplicationLogging_ForwardingEnabled_IsFalseInLocalConfigByDefault()
public void ApplicationLogging_ForwardingEnabled_IsTrueInLocalConfigByDefault()
{
Assert.IsFalse(_defaultConfig.LogEventCollectorEnabled);
Assert.IsTrue(_defaultConfig.LogEventCollectorEnabled);
}

[Test]
Expand Down

0 comments on commit 3c61a36

Please sign in to comment.