Skip to content

Instantly share code, notes, and snippets.

@gistlyn
Last active February 7, 2024 06:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gistlyn/f83364c87717910ad4cd1b06bd2cb51f to your computer and use it in GitHub Desktop.
Save gistlyn/f83364c87717910ad4cd1b06bd2cb51f to your computer and use it in GitHub Desktop.
profiling
using ServiceStack;
[assembly: HostingStartup(typeof(MyApp.ConfigureProfiling))]
namespace MyApp;
public class ConfigureProfiling : IHostingStartup
{
public void Configure(IWebHostBuilder builder) => builder
.ConfigureServices((context, services) => {
if (context.HostingEnvironment.IsDevelopment())
{
services.AddPlugin(new RequestLogsFeature
{
EnableResponseTracking = true,
});
services.AddPlugin(new ProfilingFeature
{
IncludeStackTrace = true,
});
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment