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

Adding Serilog Enrichers using App Config #30

Open
noahsyed opened this issue Sep 20, 2018 · 3 comments
Open

Adding Serilog Enrichers using App Config #30

noahsyed opened this issue Sep 20, 2018 · 3 comments
Labels

Comments

@noahsyed
Copy link

For Serilog logs enrichment using an App config how can i add standard enrichers like ProcessId, ThreadId, MachineName? The syntax to add property enricher is below but am trying to use the above standard enrichers. There's an option to implement application json which i want to avoid as it needs Serilog 2.6. Any ideas how this can be done?

As an aside question using LoggerConfiguration().ReadFrom.KeyValuePairs(...) how i can pass standard enrichers i.e. ThreadId, Environment, Process enrichers.

@noahsyed
Copy link
Author

@nblumhardt - Nick, any suggestions will be great!

@nblumhardt
Copy link
Member

Hi! Have you tried <add key="serilog:enrich:WithThreadId" /> - you'll need the appropriate "serilog:using:..." directive as well. Cheers!

@noahsyed
Copy link
Author

Yes, that works...thanks a mill!

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

No branches or pull requests

2 participants