Consider transferring logger factory to internal constructed data sources

オープン
#3,535 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
半日
初心者へのやさしさ
50/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
csharp, postgresql
領域
databases

調査の方向性

Find where the Npgsql data source is constructed in the EF Core provider, likely in the relational context configuration or options building code. Trace how the logger factory is passed from DbContextOptions to the ADO.NET layer. The fix should ensure the NpgsqlDataSource receives the ILoggerFactory so internal Npgsql logging is enabled. Run the relevant logging tests to verify the change.

索引モデルが issue の本文から書いたものです。

説明

I have configured DbContext as follows:

    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        => optionsBuilder.UseNpgsql("Host=localhost;Port=7765;Username=postgres;Password=post;Database=postgres")
            .UseLoggerFactory(loggerFactory);
}

And I expect that the Npgsql ado net driver itself will also be logged. But this is not the case. According to the EFCore code, PG is indeed not passed to LoggerFactory, and it cannot be explicitly specified in DataSource extension.

Why did they do this and is it expected?

主要言語
C#
スター
1.8k
フォーク
268
平均マージ
2時間 35分
マージ済み PR(30日)
136

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

npgsql/efcore.pg のほかの issue

npgsql/efcore.pg の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。