Is it possible to add verbose logging to System.Data.SQLite ? I want to log all db operations such as connection opened/closed and all sql commands
Yes, you can hook into the static Changed event on SQLiteConnection:
SQLiteConnection.Changed += (sender, eventArgs) =>
{
Console.WriteLine($"{eventArgs.EventType}: {eventArgs.Text}");
};
This will print out lots of information. There are other properties on that eventArgs object as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With