SQL queries not being logged from MVC / WebAPI controller

Joe Krill asked on October 22, 2014 15:14

I"m using the WebAPI for some custom REST endpoints, and was trying to debug some SQL queries within them. However, I noticed that when I enable SQL debugging, the queries that are executed in the context of my API controller are not logged. Is this expected behavior? And if so, is there something I can do explicitly in my controller to make sure these queries get logged?

Correct Answer

Martin Danko answered on December 1, 2014 14:02

Hello Joe,

What exactly is not logged? Not sure what exactly are you trying to do but I've tested it and WebAPI queries are logged in the SQL Debug but let me inform you that only queries generated by Kentico API are looged.

Best regards, Martin

0 votesVote for this answer Unmark Correct answer

Recent Answers

Joe Krill answered on December 1, 2014 15:06

Hmmm, it's been a few weeks so I don't remember the exact circumstances, but I just did a quick test and I am seeing queries being logged correctly now. I'll have to come back to this if I see the issue again in the future.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.