You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TableClient is initialized lazily and it will stop the timer that schedules flush logs whenever it fails to initialize.
171
+
// We need to check if the TableClient is null before proceeding. This helps when the first time the property is accessed is as part of the FlushLogs method.
172
+
// We should not have any events stored pending to be written since WriteDiagnosticEvent will check for an initialized TableClient.
repository.WriteDiagnosticEvent(DateTime.UtcNow,"eh1",LogLevel.Information,"This is the message","https://fwlink/",newException("exception message"));
280
285
awaitrepository.FlushLogs();
281
286
282
287
// Assert
283
-
varlogMessage=_loggerProvider.GetAllLogMessages().SingleOrDefault(m =>m.FormattedMessage.Contains("Unable to get table reference"));
284
-
Assert.NotNull(logMessage);
288
+
varcreateFailureMessagePresent=_loggerProvider.GetAllLogMessages().Any(m =>m.FormattedMessage.Contains("An error occurred initializing the Table Storage Client. We are unable to record diagnostic events, so the diagnostic logging service is being stopped."));
289
+
Assert.True(createFailureMessagePresent);
285
290
286
-
varmessagePresent=_loggerProvider.GetAllLogMessages().Any(m =>m.FormattedMessage.Contains("An error occurred initializing the Table Storage Client. We are unable to record diagnostic events, so the diagnostic logging service is being stopped."));
287
-
Assert.True(messagePresent);
291
+
varpurgeEventMessagePresent=_loggerProvider.GetAllLogMessages().Any(m =>m.FormattedMessage.Contains("Purging diagnostic events with versions older than"));
0 commit comments