Closed bobskigit closed 3 years ago
Thanks for the error report. It's caused by you sending in a log that has a self referencing loop, e.g.
var foo = new Foo();
var bar = new Bar();
// Make them refer to each other
bar.foo = foo;
foo.Bar = new bar;
logger.LogInformation("here is a self-referencing {obj}", foo);
We'll fix this.
In the meantime, you can fix this in your project:
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers().AddNewtonsoftJson(x => x.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore);
}
FYI, as of v6, you can now do this:
// Call this extension method *before* calling docStore.Initialize()
docStore.IgnoreSelfReferencingLoops();
Error while saving logs: