In a production system, do you configure your logging in appsettings or in code?

Viewed 92

In ASP.NET Core we can configure logging in the appsettings.json file or in code.

I am looking for pros/cons on what to choose for a modern ASP.NET Core service.

Putting it in appsettings.json could be convenient if you want to be able to tweak the logging without redeploying your application. However, when we move to immutable infrastructure, containers that you can't login to, then I guess the possibility to tweak appsettings.json is no longer a valid argument.

Where/how would you configure logging if you were developing a new application today?

1 Answers

Short Answer:

  1. Try to google environment variables in asp.net core.
  2. A fast lightweight NOSQL DB, where you can store your app settings and create a lightweight wrapper service to query them.
Related