Skip to content

Instantly share code, notes, and snippets.

@gistlyn
Created September 9, 2024 07:59
Show Gist options
  • Save gistlyn/c8441f82377cfed3a35006a51b33020d to your computer and use it in GitHub Desktop.
Save gistlyn/c8441f82377cfed3a35006a51b33020d to your computer and use it in GitHub Desktop.
requestlogs
using ServiceStack;
[assembly: HostingStartup(typeof(MyApp.ConfigureRequestLogs))]
namespace MyApp;
public class ConfigureRequestLogs : IHostingStartup
{
public void Configure(IWebHostBuilder builder) => builder
.ConfigureServices((context, services) => {
if (context.HostingEnvironment.IsDevelopment())
{
services.AddPlugin(new RequestLogsFeature
{
EnableResponseTracking = true,
});
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment