is there a way to log all linq2DB sql queries that are made to he database with NLog?
I cannot find any realistic example. There is something for miniprofiler, but this doesn't help me, because I have not experience with it.
pull request
example
example 2
Inside your Setup method you could turn on Trace and setup WriteTraceLine to Console.WriteLine
[SetUp]
public void Setup()
{
LinqToDB.Data.DataConnection.TurnTraceSwitchOn();
LinqToDB.Data.DataConnection.WriteTraceLine = (message, displayName) => { Console.WriteLine($"{message} {displayName}"); };
}
This will write all executed SQL Queries (together with params) to the Console
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