a WebApi Logger based on ASP.NET Core, which can tracking asp.net core webapi request/response in a winform application via RabbitMQ
- RabbitMQ
- Azure Service Bus(Release in 2.0 version)
- You need to add the reference for
WebApiLogger.Core
andWebApiLogger.Host
- Register the ILoggerData in the DI and load the config
services.AddScoped<ILoggerData, LoggerData>();
services.AddOptions();
services.Configure<LogSetting>(Configuration.GetSection("LogSettings"));
- Use the
LoggerMiddleware
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseMiddleware<LoggerMiddleware>();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseMvc();
}