mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-05-01 13:12:50 +08:00

* hacking around to work out why logging and request id isnt working * pass request id into logger so it can be structured, removed a bunch of debug logging we dont need because diagnostic trace gets it * changed config dependency * always have tracing available * made it so we dont need to pass config into services.AddOcelot anymore with .net core 2.0 * add test * lots of changes relating to logging and request ids, also updated documentation * fixed failing test i missed
29 lines
900 B
C#
29 lines
900 B
C#
using CacheManager.Core;
|
|
using Microsoft.AspNetCore.Hosting;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Logging;
|
|
using Ocelot.DependencyInjection;
|
|
using Ocelot.AcceptanceTests.Caching;
|
|
|
|
namespace Ocelot.AcceptanceTests
|
|
{
|
|
public class StartupWithCustomCacheHandle : AcceptanceTestsStartup
|
|
{
|
|
public StartupWithCustomCacheHandle(IHostingEnvironment env) : base(env) { }
|
|
|
|
public override void ConfigureServices(IServiceCollection services)
|
|
{
|
|
services.AddOcelot(Configuration)
|
|
.AddCacheManager((x) =>
|
|
{
|
|
x.WithMicrosoftLogging(log =>
|
|
{
|
|
log.AddConsole(LogLevel.Debug);
|
|
})
|
|
.WithJsonSerializer()
|
|
.WithHandle(typeof(InMemoryJsonHandle<>));
|
|
});
|
|
}
|
|
}
|
|
}
|