From ee7da74ba7bf1a107f14a768bfc97d8743c8bf77 Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Thu, 13 Oct 2022 13:22:15 -0700 Subject: [PATCH] Add additional logging when opening connections --- src/SqlAsyncCollector.cs | 4 +++- src/SqlConverters.cs | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/SqlAsyncCollector.cs b/src/SqlAsyncCollector.cs index ca6e420b1..2a49e88d3 100644 --- a/src/SqlAsyncCollector.cs +++ b/src/SqlAsyncCollector.cs @@ -160,7 +160,9 @@ private async Task UpsertRowsAsync(IEnumerable rows, SqlAttribute attribute, var upsertRowsAsyncSw = Stopwatch.StartNew(); using (SqlConnection connection = SqlBindingUtilities.BuildConnection(attribute.ConnectionStringSetting, configuration)) { + this._logger.LogDebugWithThreadId("BEGIN OpenUpsertRowsAsyncConnection"); await connection.OpenAsync(); + this._logger.LogDebugWithThreadId("END OpenUpsertRowsAsyncConnection"); Dictionary props = connection.AsConnectionProps(); string fullTableName = attribute.CommandText; @@ -403,7 +405,7 @@ public TableInformation(IEnumerable primaryKeys, IDictionary BuildItemFromAttributeAsync(SqlAttribute attri using (SqlCommand command = SqlBindingUtilities.BuildCommand(attribute, connection)) { adapter.SelectCommand = command; + this._logger.LogDebugWithThreadId("BEGIN OpenBuildItemFromAttributeAsyncConnection"); await connection.OpenAsync(); + this._logger.LogDebugWithThreadId("END OpenBuildItemFromAttributeAsyncConnection"); Dictionary props = connection.AsConnectionProps(); TelemetryInstance.TrackConvert(type, props); var dataTable = new DataTable();