nblumhardt / serilog-timings

Extends Serilog with support for timed operations
Apache License 2.0
218 stars 22 forks source link

Destructuring Issue With Destructurama.Attributes #38

Closed bsulliva closed 2 years ago

bsulliva commented 4 years ago

Hello, I'm using this github package, serilog-timings, and destrcuturama.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. Is it possible to apply destructuring rules to both?

` using (var op = Operation.Begin("({OutGoingUrl}) {Message} {@RequestBody}", url, "Method Called", request) { try { var response = output();

                if (logResponse)
                {
                    op.Complete("Result", response, true);
                }
                else
                {
                    op.Complete();
                }
                return response;
            }
            catch (Exception ex) when (op.SetExceptionAndRethrow(ex))
            {
                LogMethodFailure(log, ex, url);
                throw;
            }
        }

nblumhardt commented 4 years ago

Hi! Thanks for the note - this isn't possible currently; I'm not sure what would be involved to make it work, but seems reasonable if anyone is able to dig in and check it out 👍

nblumhardt commented 2 years ago

Closing this one as stale.