'Log notices with Npgsql and EF Core

I'm using Npgsql 5 with EF Core 5.

I added "Microsoft.EntityFrameworkCore": "Information" to my appsettings.json.

Suppose I have a sql command that includes this:

RAISE NOTICE 'foo';

How do I configure the provider to log that?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source