Specifying .Destructure.ByTransforming<T>() in the config
See original GitHub issueI have migrated recently from defining Serilog config in code to appsettings.json.
I would like to be able to specify things like .Destructure.ByTransforming<CultureInfo>(c => new { c.LCID, c.Name })
. Even simplified syntax would be fine.
Issue Analytics
- State:
- Created 5 years ago
- Comments:39 (36 by maintainers)
Top Results From Across the Web
Serilog Destructure.ByTransforming<Interface>() not working
The Destructure.With() function can take as many polices as you want. It looks like Serilog checks for registered type destructures then it will ......
Read more >Setting Default Values with JavaScript's Destructuring
With destructuring we can set defaults, or fallback values so that if an item is not in the object (or Array, Map, or...
Read more >vue/no-setup-props-destructure
Rule Details . This rule reports the destructuring of props passed to setup causing the value to lose reactivity.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
Top Related Hashnode Post
No results found
Not sure if this is related and may find some commonality, but I have a repo in here, Serilog.Settings.Code, where I load the config as C# from an arbitrary file (typically a
.csx
file) … in case that helps 😃It is based on
Microsoft.CodeAnalysis.CSharp.Scripting
which itself is based on Roslyn.Starting work on a PR for the other less complicated destructure syntax (i.e. that won’t require any new features) so that delegates can be added as a separate extensions package.
So, @zippy1981 I guess the answer to your end-game question is that I’ll be managing a nuget package with this feature. Give me a bit more time, ultimately I want parity with “real” Serilog package quality – docs, tests, Travis, and AppVeyor support. Or if anyone else feels like working on a PR in my repo for that (while I add destructure to Config), please feel free.