Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DestructureObjects = true Not Working #47

Closed
bsulliva opened this issue Oct 19, 2020 · 2 comments
Closed

DestructureObjects = true Not Working #47

bsulliva opened this issue Oct 19, 2020 · 2 comments

Comments

@bsulliva
Copy link

Hello, I'm using this github package, serilog-timings, and destructurama.attributed. I've found that when I set destructureObjects to true in the following code, op.Complete("Result", response, true);, it does not enforce the Destructure.MaxDepth and Destrcuture.UsingAttributes. It is only being enforced in the message template when I use the @ operator. I've also seen when using .ForContext(), its the same thing, log.ForContext("RequestBody", request, true).

Is it possible to apply destructuring rules to both?

@SimonCropp
Copy link
Contributor

can you share a failing unit test as a pull request

@sungam3r
Copy link
Member

It is only being enforced in the message template when I use the @ operator.

I think that this is the right behavior. Otherwise ToString() is used without traversing object structure. See https://github.com/serilog/serilog/wiki/Structured-Data#objects :

When Serilog doesn't recognise the type, and no operator is specified (see below) then the object will be rendered using ToString().

And https://github.com/serilog/serilog/wiki/Structured-Data#preserving-object-structure .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants