Skip to content

Add EF Core-style logging for bulk insert operations#103

Merged
PhenX merged 4 commits into
mainfrom
copilot/add-logging-similar-to-ef-core
May 24, 2026
Merged

Add EF Core-style logging for bulk insert operations#103
PhenX merged 4 commits into
mainfrom
copilot/add-logging-similar-to-ef-core

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 23, 2026

  • Re-validate current state (build/tests) before new edits
  • Update documentation for logging/DI changes in README/docs
  • Update Copilot instructions to require docs/README/tests updates for relevant changes
  • Run targeted tests (logging) and quick build validation
  • Run final validation checks and reply with commit hash

Copilot AI linked an issue May 23, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add logging similar to native EF Core logging Add EF Core-style logging for bulk insert operations May 23, 2026
Copilot AI requested a review from PhenX May 23, 2026 06:50
Copilot finished work on behalf of PhenX May 23, 2026 06:50
@PhenX PhenX marked this pull request as ready for review May 23, 2026 06:54
@PhenX PhenX requested a review from Copilot May 23, 2026 06:55
Copy link
Copy Markdown
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

This PR adds EF Core-style structured logging around bulk insert operations (timing + auxiliary SQL debug logs) and updates DI/service lifetimes so logging can be resolved correctly from EF Core’s internal service provider.

Changes:

  • Introduces new LoggerMessage definitions for bulk insert timing (Info) and auxiliary SQL command execution (Debug).
  • Wraps bulk insert and internal SQL execution with Stopwatch timing and emits the new log events.
  • Switches provider construction to use ILoggerFactory and changes IBulkInsertProvider registration to scoped; adds a fallback NullLoggerFactory.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/PhenX.EntityFrameworkCore.BulkInsert.Tests/Tests/Logging/LoggingTests.cs Adds tests asserting the new logging events are emitted for SQLite bulk insert paths.
tests/PhenX.EntityFrameworkCore.BulkInsert.Tests/Tests/Logging/CapturingLogger.cs Adds a small logger/provider to capture log entries in tests.
src/PhenX.EntityFrameworkCore.BulkInsert/Log.cs Adds event IDs 1004/1005 with structured message templates.
src/PhenX.EntityFrameworkCore.BulkInsert/BulkInsertProviderBase.cs Adds timing + log emission for bulk insert and auxiliary SQL execution; switches to ILoggerFactory.
src/PhenX.EntityFrameworkCore.BulkInsert/BulkInsertOptionsExtension.cs Updates service registration to scoped provider + ILoggerFactory fallback.
src/PhenX.EntityFrameworkCore.BulkInsert.SqlServer/SqlServerBulkInsertProvider.cs Updates ctor to accept ILoggerFactory.
src/PhenX.EntityFrameworkCore.BulkInsert.Sqlite/SqliteBulkInsertProvider.cs Updates ctor to accept ILoggerFactory.
src/PhenX.EntityFrameworkCore.BulkInsert.PostgreSql/PostgreSqlBulkInsertProvider.cs Updates ctor to accept ILoggerFactory.
src/PhenX.EntityFrameworkCore.BulkInsert.Oracle/OracleBulkInsertProvider.cs Updates ctor to accept ILoggerFactory.
src/PhenX.EntityFrameworkCore.BulkInsert.MySql/MySqlBulkInsertProvider.cs Updates ctor to accept ILoggerFactory.

Comment thread src/PhenX.EntityFrameworkCore.BulkInsert/BulkInsertProviderBase.cs Outdated
Comment thread src/PhenX.EntityFrameworkCore.BulkInsert/BulkInsertProviderBase.cs Outdated
Comment thread tests/PhenX.EntityFrameworkCore.BulkInsert.Tests/Tests/Logging/LoggingTests.cs Outdated
Comment thread tests/PhenX.EntityFrameworkCore.BulkInsert.Tests/Tests/Logging/LoggingTests.cs Outdated
Comment thread tests/PhenX.EntityFrameworkCore.BulkInsert.Tests/Tests/Logging/LoggingTests.cs Outdated
@PhenX
Copy link
Copy Markdown
Owner

PhenX commented May 23, 2026

@copilot apply code review suggestions

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 23, 2026

@copilot apply code review suggestions

Applied the requested review fixes in commit 2391791: updated bulk-insert timing log to use the actual executed table name, disposed DbCommand in ExecuteAsync, and disposed DbContext instances in logging tests. There are no UI changes in this PR, so no screenshot applies.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.example.com
    • Triggering command: /opt/oracle/product/26ai/dbhomeFree/bin/oracle oracleFREE (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq))) (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of PhenX May 23, 2026 07:37
@PhenX
Copy link
Copy Markdown
Owner

PhenX commented May 24, 2026

@copilot update the docs accordingly, and update the copilot instructions : to always update the docs when the public API changes, the README when notables changes are added, or modified, and to update the tests

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 24, 2026

@copilot update the docs accordingly, and update the copilot instructions : to always update the docs when the public API changes, the README when notables changes are added, or modified, and to upda...

Done in commit efb336b. I updated the docs (README and docs/documentation.md) with the new logging behavior and event IDs, and updated .github/copilot-instructions.md to require updating docs for public API changes, README for notable feature/behavior changes, and tests for behavior changes. There are no UI changes in this PR, so no screenshot applies.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.example.com
    • Triggering command: /opt/oracle/product/26ai/dbhomeFree/bin/oracle oracleFREE (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq))) (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of PhenX May 24, 2026 15:06
@PhenX PhenX merged commit 03e3619 into main May 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add logging similar to native EF Core logging

3 participants