Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NHibernate, Log query execution time?

I configured Nhibernate and log4net to log queries executed by nhibernate. Is there any way to log each query execution time?

like image 477
Adrian Serafin Avatar asked Sep 10 '10 07:09

Adrian Serafin


2 Answers

Just configure your ConversionPattern to use the '%d' parameter. Look at this example.

like image 195
goenning Avatar answered Oct 23 '22 19:10

goenning


You might want to try nhibernate profiler. It has 30 day trial which is enough to figure out what's happening and catch all problems. And it's a nice tool in general - worth buying in case You rely on nhibernate heavily.

like image 33
Arnis Lapsa Avatar answered Oct 23 '22 20:10

Arnis Lapsa