Skip to content

Commit d76bcf9

Browse files
authored
Reliable channel: replacing logAlways "TRACE" statements with "info" (#571)
1 parent 09b9bbb commit d76bcf9

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionFileSystemOutput.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public TransmissionFileSystemOutput(String folderPath) {
135135
@Override
136136
public boolean send(Transmission transmission) {
137137
if (size.get() >= capacityInKB) {
138-
InternalLogger.INSTANCE.logAlways(InternalLogger.LoggingLevel.WARN, "Persistent storage max capcity has been reached; currently at %s KB. Telemetry will be lost, please set the MaxTransmissionStorageFilesCapacityInMB property in the configuration file.", size.get());
138+
InternalLogger.INSTANCE.logAlways(InternalLogger.LoggingLevel.WARN, "Persistent storage max capacity has been reached; currently at %s KB. Telemetry will be lost, please set the MaxTransmissionStorageFilesCapacityInMB property in the configuration file.", size.get());
139139
return false;
140140
}
141141

@@ -152,7 +152,7 @@ public boolean send(Transmission transmission) {
152152
return false;
153153
}
154154

155-
InternalLogger.INSTANCE.logAlways(InternalLogger.LoggingLevel.TRACE, "Persistent storage saved permanent file; data will be persisted and sent when the network is available.");
155+
InternalLogger.INSTANCE.info("Data persisted to file. To be sent when the network is available.");
156156
return true;
157157
}
158158

core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/TransmissionPolicyManager.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ public void backoff() {
112112
long backOffMillis = backoffManager.backOffCurrentSenderThreadValue();
113113
if (backOffMillis > 0)
114114
{
115-
long backOffSeconds = backOffMillis / 1000;
116-
InternalLogger.INSTANCE.logAlways(InternalLogger.LoggingLevel.TRACE, "App is throttled, telemetry will be blocked for %s seconds.", backOffSeconds);
117-
this.suspendInSeconds(TransmissionPolicy.BACKOFF, backOffSeconds);
115+
long backOffSeconds = backOffMillis / 1000;
116+
InternalLogger.INSTANCE.info("App is throttled, telemetry will be blocked for %s seconds.", backOffSeconds);
117+
this.suspendInSeconds(TransmissionPolicy.BACKOFF, backOffSeconds);
118118
}
119119
}
120120

@@ -124,7 +124,7 @@ public void backoff() {
124124
public void clearBackoff() {
125125
policyState.setCurrentState(TransmissionPolicy.UNBLOCKED);
126126
backoffManager.onDoneSending();
127-
InternalLogger.INSTANCE.logAlways(InternalLogger.LoggingLevel.TRACE, "Backoff has been reset.");
127+
InternalLogger.INSTANCE.info("Backoff has been reset.");
128128
}
129129

130130
/**
@@ -181,7 +181,7 @@ private synchronized void doSuspend(TransmissionPolicy policy, long suspendInSec
181181
policyState.setCurrentState(policy);
182182
suspensionDate = date;
183183

184-
InternalLogger.INSTANCE.logAlways(InternalLogger.LoggingLevel.TRACE, "App is throttled, telemetries are blocked from now, for %s seconds", suspendInSeconds);
184+
InternalLogger.INSTANCE.info("App is throttled, telemetries are blocked from now, for %s seconds", suspendInSeconds);
185185
} catch (Throwable t) {
186186
InternalLogger.INSTANCE.logAlways(InternalLogger.LoggingLevel.ERROR, "App is throttled but failed to block transmission exception: %s", t.getMessage());
187187
}
@@ -194,7 +194,7 @@ private synchronized void cancelSuspension(long expectedGeneration) {
194194

195195
policyState.setCurrentState(TransmissionPolicy.UNBLOCKED);
196196
suspensionDate = null;
197-
InternalLogger.INSTANCE.logAlways(InternalLogger.LoggingLevel.TRACE, "App is throttled is cancelled");
197+
InternalLogger.INSTANCE.info("App throttling is cancelled.");
198198
}
199199

200200
private synchronized void createScheduler() {

0 commit comments

Comments
 (0)