Skip to content

Move Logging from Extensions to Internal#4038

Merged
cheenamalhotra merged 7 commits intomainfrom
dev/paul/logging-internal
Mar 13, 2026
Merged

Move Logging from Extensions to Internal#4038
cheenamalhotra merged 7 commits intomainfrom
dev/paul/logging-internal

Conversation

@paulmedynski
Copy link
Contributor

@paulmedynski paulmedynski commented Mar 12, 2026

Description

This PR moves the Logging package from the Extensions area into a new Internal area:

  • Renamed the NuGet package to Microsoft.Data.SqlClient.Internal.Logging.
  • Added public docs indicating it should not be used by apps directly.
  • Created the Microsoft.Data.SqlClient.Internal namespace for the types in the Logging package.
  • Moved the source files into an Internal directory.

Testing

Our variety of pipelines will confirm the changes.

@paulmedynski paulmedynski added this to the 7.0.0 milestone Mar 12, 2026
@paulmedynski paulmedynski added the Area\Azure Connectivity Use this to tag issues that are related to Azure connectivity. label Mar 12, 2026
Copilot AI review requested due to automatic review settings March 12, 2026 18:07
@github-project-automation github-project-automation bot moved this to To triage in SqlClient Board Mar 12, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the repository to consume and ship the logging/EventSource component as Microsoft.Data.SqlClient.Internal.Logging instead of Microsoft.Data.SqlClient.Extensions.Logging, including dependency wiring across build tooling, pipelines, and the main driver/extension projects.

Changes:

  • Renames the Logging package (NuGet/package references and build pipeline publishing) to Microsoft.Data.SqlClient.Internal.Logging.
  • Updates core driver + extensions to reference Microsoft.Data.SqlClient.Internal types (notably SqlClientEventSource) via new using directives and updated project/package references.
  • Updates packaging specs and OneBranch/CI pipeline metadata to publish the renamed package.

Reviewed changes

Copilot reviewed 103 out of 104 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tools/specs/Microsoft.Data.SqlClient.nuspec Switches dependency ID from Extensions.Logging to Internal.Logging in nuspec dependency groups.
tools/props/Versions.props Imports Logging version props from the new Internal/Logging location.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlTypes/SqlTypeWorkarounds.cs Adds Microsoft.Data.SqlClient.Internal using; whitespace cleanup.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlTypes/SqlFileStream.windows.cs Adds Microsoft.Data.SqlClient.Internal using for internal logging access.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObjectNative.windows.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObjectManaged.netcore.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObjectFactory.windows.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObject.Multiplexer.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserSessionPool.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserSafeHandles.windows.cs Adds Microsoft.Data.SqlClient.Internal using (netfx conditional block).
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParser.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SSPI/SspiContextProvider.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SSPI/NegotiateSspiContextProvider.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlTransaction.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlInternalTransaction.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlError.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependencyUtils.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependencyListener.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDependency.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDelegatedTransaction.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDataReader.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDataAdapter.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlConnectionFactory.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlConnection.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommandSet.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Xml.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Scalar.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.Reader.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.NonQuery.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlClientLogger.cs Updates to use SqlClientEventSource from Internal namespace via using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlClientEventSource.cs Updates doc comment to reference Internal.Logging package; adds Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlBulkCopy.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAppContextSwitchManager.netcore.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/SqlConfigurableRetryLogicManager.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/SqlConfigurableRetryLogicLoader.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/SqlConfigurableRetryFactory.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/Common/SqlRetryLogicProvider.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/Common/SqlRetryLogic.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Reliability/AppConfigManager.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SsrpClient.netcore.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SslOverTdsStream.netcore.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniTcpHandle.netcore.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniSslStream.netcore.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniProxy.netcore.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniPacket.netcore.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniNpHandle.netcore.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniNetworkStream.netcore.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniMarsHandle.netcore.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniMarsConnection.netcore.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniCommon.netcore.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/LocalDB.netcore.windows.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/LocalDb/LocalDbApi.windows.cs Adds Microsoft.Data.SqlClient.Internal using (netfx conditional block).
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/LocalAppContextSwitches.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Diagnostics/SqlClientMetrics.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/WaitHandleDbConnectionPool.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/TransactedConnectionPool.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/SqlConnectionPoolGroupProviderInfo.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/DbConnectionPoolGroup.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/ChannelDbConnectionPool.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Connection/SqlConnectionInternal.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/Sql/SqlDataSourceEnumeratorNativeHelper.windows.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/Sql/SqlDataSourceEnumeratorManagedHelper.netcore.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/ProviderBase/DbConnectionInternal.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/DataException.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/ConnectionString/DbConnectionString.netfx.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/ConnectionString/DbConnectionOptions.Debug.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/AdapterUtil.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj Updates project/package reference from Extensions.Logging to Internal.Logging.
src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj Updates legacy netfx project/package reference to Internal.Logging.
src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj Updates legacy netcore project/package reference to Internal.Logging.
src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/SqlColumnEncryptionAzureKeyVaultProvider.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj Updates logging project/package reference to Internal.Logging.
src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/LocalCache.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/AzureSqlKeyCryptographer.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient.sln Updates solution to reference new Internal/Logging project location and adds solution folder.
src/Microsoft.Data.SqlClient.Internal/Logging/src/SqlClientEventSource.cs Changes namespace to Microsoft.Data.SqlClient.Internal for the EventSource type.
src/Microsoft.Data.SqlClient.Internal/Logging/src/PackageReadme.md Updates package readme branding/links to Internal.Logging and adds “internal package” disclaimer.
src/Microsoft.Data.SqlClient.Internal/Logging/src/LoggingVersions.props Adds version props file for Internal.Logging.
src/Microsoft.Data.SqlClient.Internal/Logging/src/Logging.csproj Renames assembly/package metadata to Internal.Logging.
src/Microsoft.Data.SqlClient.Extensions/Azure/src/PackageReadme.md Updates related package link to Internal.Logging.
src/Microsoft.Data.SqlClient.Extensions/Azure/src/Azure.csproj Updates logging project/package reference to Internal.Logging.
src/Microsoft.Data.SqlClient.Extensions/Azure/src/ActiveDirectoryAuthenticationProvider.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationProvider.Internal.cs Adds Microsoft.Data.SqlClient.Internal using.
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/PackageReadme.md Updates related package link to Internal.Logging.
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Abstractions.csproj Updates logging project/package reference to Internal.Logging.
release-notes/Extensions/Logging/1.0/README.md Adds “internal use” disclaimer (but remains under Extensions/Logging).
release-notes/Extensions/Logging/1.0/1.0.0-preview1.md Adds “internal use” disclaimer text for the logging package release notes.
eng/pipelines/stages/build-logging-package-ci-stage.yml Updates package name comments to Internal.Logging.
eng/pipelines/onebranch/stages/release-stages.yml Updates OneBranch release publishing configuration to push Internal.Logging nupkg.
eng/pipelines/onebranch/stages/build-stages.yml Updates OneBranch build stage package full name to Internal.Logging; updates comments.
eng/pipelines/onebranch/sqlclient-official.yml Updates parameter display text to Internal.Logging.
eng/pipelines/onebranch/sqlclient-non-official.yml Updates parameter display text to Internal.Logging.
eng/pipelines/onebranch/jobs/build-signed-sqlclient-package-job.yml Updates build job comment to Internal.Logging dependency name.
eng/pipelines/onebranch/jobs/build-akv-official-job.yml Updates build job comment to Internal.Logging dependency name.
eng/pipelines/jobs/pack-logging-package-ci-job.yml Points packing job to new Internal/Logging csproj path.
doc/apps/AzureAuthentication/README.md Updates listed transitive package to Internal.Logging.
Directory.Packages.props Updates central package version entry from Extensions.Logging to Internal.Logging.
build2.proj Updates build arg description to Internal.Logging.
build.proj Updates Logging project glob/path to Internal/Logging csproj.
.github/prompts/release-notes.prompt.md Updates release-notes automation mapping for the new Internal.Logging package.
.github/instructions/onebranch-pipeline-design.instructions.md Updates pipeline design doc references from Extensions.Logging to Internal.Logging.
Comments suppressed due to low confidence (1)

src/Microsoft.Data.SqlClient.Internal/Logging/src/SqlClientEventSource.cs:12

  • Changing the namespace of the public SqlClientEventSource type from Microsoft.Data.SqlClient to Microsoft.Data.SqlClient.Internal is a breaking change for any consumers that referenced Microsoft.Data.SqlClient.SqlClientEventSource (the file header itself notes external libraries depend on this surface). If the goal is only to rename the NuGet package, consider keeping the original namespace (or providing a shim/forwarder type in the old namespace) to preserve source compatibility.

You can also share your feedback on Copilot code review. Take the survey.

@codecov
Copy link

codecov bot commented Mar 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.40%. Comparing base (14b96a2) to head (600ae4c).
⚠️ Report is 4 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (14b96a2) and HEAD (600ae4c). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (14b96a2) HEAD (600ae4c)
CI-SqlClient 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4038      +/-   ##
==========================================
- Coverage   74.62%   65.40%   -9.23%     
==========================================
  Files         280      275       -5     
  Lines       43814    65809   +21995     
==========================================
+ Hits        32698    43043   +10345     
- Misses      11116    22766   +11650     
Flag Coverage Δ
CI-SqlClient ?
PR-SqlClient-Project 65.40% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@paulmedynski paulmedynski moved this from To triage to In progress in SqlClient Board Mar 12, 2026
cheenamalhotra
cheenamalhotra previously approved these changes Mar 13, 2026
@cheenamalhotra
Copy link
Member

LGTM! Would recommend running a non-official build to validate the final packages.

@paulmedynski paulmedynski moved this from In progress to In review in SqlClient Board Mar 13, 2026
Copilot AI review requested due to automatic review settings March 13, 2026 12:40
@paulmedynski paulmedynski marked this pull request as ready for review March 13, 2026 12:43
@paulmedynski paulmedynski requested a review from a team as a code owner March 13, 2026 12:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 102 out of 103 changed files in this pull request and generated 3 comments.


You can also share your feedback on Copilot code review. Take the survey.

Copy link
Contributor

@mdaigle mdaigle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good, we'll need to clean up the release notes when we add notes for the GA.

@cheenamalhotra cheenamalhotra merged commit c31997c into main Mar 13, 2026
296 checks passed
@cheenamalhotra cheenamalhotra deleted the dev/paul/logging-internal branch March 13, 2026 17:53
@github-project-automation github-project-automation bot moved this from In review to Done in SqlClient Board Mar 13, 2026
This was referenced Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area\Azure Connectivity Use this to tag issues that are related to Azure connectivity.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants