Serilog: Maximum depth of objects destructuring should be controllable

Created on 25 Sep 2014  ·  3Comments  ·  Source: serilog/serilog

At this time maximum depth of objects destructuring is a constant 10, I believe. In most cases it is too much, simply because it is practically unusable to refer to something from that deep in log queries.

It would help if this value ("MaxDestructureDepth") become optional parameter. Please consider it.

Thank you!
Konstantin

Most helpful comment

Default is now 5.

To increase:

var log = new LoggerConfiguration()
  .Destructure.ToMaximumDepth(100)
  .CreateLogger();

All 3 comments

I've found with a depth of 10 links recursive graphs also get very large - it does seem like 10's the wrong default.

I'll give some thought as to how to tackle this in a way that lets logging code, rather than configuration code, control the depth.

Thanks!

Default is now 5.

To increase:

var log = new LoggerConfiguration()
  .Destructure.ToMaximumDepth(100)
  .CreateLogger();

Very good! Thank you!

< sent from mobile device >

On Nov 15, 2014, at 5:04 PM, Nicholas Blumhardt <[email protected]notifications@github.com> wrote:

Default is now 5.

To increase:

var log = new LoggerConfiguration()
.Destructure.ToMaximumDepth(100)
.CreateLogger();

Reply to this email directly or view it on GitHubhttps://github.com/serilog/serilog/issues/227#issuecomment-63199817.

Was this page helpful?
0 / 5 - 0 ratings