Skip to content

Commit 01c8ff2

Browse files
Add additional logging when opening connections (#397)
1 parent 33abc1d commit 01c8ff2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/SqlAsyncCollector.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ private async Task UpsertRowsAsync(IEnumerable<T> rows, SqlAttribute attribute,
163163
var upsertRowsAsyncSw = Stopwatch.StartNew();
164164
using (SqlConnection connection = SqlBindingUtilities.BuildConnection(attribute.ConnectionStringSetting, configuration))
165165
{
166+
this._logger.LogDebugWithThreadId("BEGIN OpenUpsertRowsAsyncConnection");
166167
await connection.OpenAsync();
168+
this._logger.LogDebugWithThreadId("END OpenUpsertRowsAsyncConnection");
167169
Dictionary<TelemetryPropertyName, string> props = connection.AsConnectionProps();
168170

169171
string fullTableName = attribute.CommandText;
@@ -420,7 +422,7 @@ public TableInformation(IEnumerable<PropertyInfo> primaryKeys, IDictionary<strin
420422
this.HasIdentityColumnPrimaryKeys = hasIdentityColumnPrimaryKeys;
421423

422424
// Convert datetime strings to ISO 8061 format to avoid potential errors on the server when converting into a datetime. This
423-
// is the only format that are an international standard.
425+
// is the only format that are an international standard.
424426
// https://docs.microsoft.com/previous-versions/sql/sql-server-2008-r2/ms180878(v=sql.105)
425427
this.JsonSerializerSettings = new JsonSerializerSettings
426428
{

src/SqlConverters.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,9 @@ public virtual async Task<string> BuildItemFromAttributeAsync(SqlAttribute attri
178178
using (SqlCommand command = SqlBindingUtilities.BuildCommand(attribute, connection))
179179
{
180180
adapter.SelectCommand = command;
181+
this._logger.LogDebugWithThreadId("BEGIN OpenBuildItemFromAttributeAsyncConnection");
181182
await connection.OpenAsync();
183+
this._logger.LogDebugWithThreadId("END OpenBuildItemFromAttributeAsyncConnection");
182184
Dictionary<TelemetryPropertyName, string> props = connection.AsConnectionProps();
183185
TelemetryInstance.TrackConvert(type, props);
184186
var dataTable = new DataTable();

0 commit comments

Comments
 (0)