serilog-settings-configuration icon indicating copy to clipboard operation
serilog-settings-configuration copied to clipboard

How to configure with multiple instances of same app/executable?

Open askids opened this issue 2 years ago • 1 comments

hi,

I have an app that runs multiple instances of .Net windows Service (like Instance1, Instance2 etc) using same exe, but with different arguments. Now I am trying to add Serilog configuration to this app and planning to use File sink. In such case, how can I make sure that each instance is using its own file as the appsettings file will be common?

Thanks!

askids avatar Oct 21 '22 04:10 askids

You can pass different names via environment variables https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-7.0#non-prefixed-environment-variables or command line https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-7.0#command-line to override "fixed" setting from json configuration file.

sungam3r avatar Mar 13 '23 06:03 sungam3r