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

[Docs] Destructurer via json #300

Closed
lonix1 opened this issue Feb 28, 2021 · 3 comments
Closed

[Docs] Destructurer via json #300

lonix1 opened this issue Feb 28, 2021 · 3 comments
Labels
enhancement Issues describing an enhancement or pull requests adding an enhancement.

Comments

@lonix1
Copy link

lonix1 commented Feb 28, 2021

I have all my config in json. Does anyone know how to use the destructurer via json?

For example, for Serilog.Exceptions.EntityFrameworkCore:

.Enrich.WithExceptionDetails(
  new DestructuringOptionsBuilder()
  .WithDefaultDestructurers()
  .WithDestructurers(new[] { new DbUpdateExceptionDestructurer() })
)

How is that represented in the appsettings.json?

It would also be useful to add that to the docs in the corresponding section.

@lonix1 lonix1 added the enhancement Issues describing an enhancement or pull requests adding an enhancement. label Feb 28, 2021
@RehanSaeed
Copy link
Owner

See #58 for a bit more info. We don't currently support serilog-settings-configuration. It would be a nice addition. If you'd like to suggest an idea with a PR, we'd consider it.

@lonix1
Copy link
Author

lonix1 commented Mar 1, 2021

I wouldn't know how :) I realise you can't support every config scenario though! Feel free to close.


BTW I'm confused about the comment in that other issue about how most modern systems use config in code rather than json. The serilog authors also have that opinion.

But in small environments (few people) or when you're working alone, you don't have tools and time to do things "properly". So you deploy to production and tweak config files by hand if you need to. The advice against this is only sensible for large teams/companies with CI.

Anyways, thanks for this very useful plugin, it's appreciated!

@RehanSaeed
Copy link
Owner

I went on the same search as you for using JSON and came to the same realization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues describing an enhancement or pull requests adding an enhancement.
Projects
None yet
Development

No branches or pull requests

2 participants