Is it possible to get the same level of information from mini-profiler when using it in a console app as you can get when in a web app? Ideally, I'd just like to self host the web UI in the console, but it doesn't look like that's possible.
My main goal is to get the sqlqueries that are being executed out as/when calls are made and their parameters/run time. I've tried the RenderPlainText() solution, and its nowhere near as detailed as the webview, and there doesn't seem to be a hook I can use to log its contents when something interesting happens.
There isn't a built-in way to get a full-fledged text-based output of profiler (
RenderPlainText()is what's in the box) since people all seem to want various pieces of complex data. But there are a few options! You can:profiler.GetTimingHierarchy()available for this to get them all as a list, for example:Which would yield:
.UserIdProvideron options (defaults to IP address on the web side). For example, in ASP.NET Core:When going with the second option, note that the URLs are consistent and all that's changing is the GUID if you click "share" from a MiniProfiler web UI. You could take the current
profiler.Idand use that to spit out a handy link to your console.