0

I'm trying to configure the Loglevel for HttpClient and a custom component using environment variables. the configuration in json would be something like this:

{
  "Logging": {
    "LogLevel": {
      "System.Net.Http.HttpClient": "Debug",
      "MyCompany.MyProduct.MyComponent": "Debug"
    }
  }
}

Tried this values in windows and works:

"Logging__LogLevel__System.Net.Http.HttpClient"
"Logging__LogLevel__MyCompany.MyProduct.MyComponent"

Tried this in Linux but it doesn't work:

"Logging__LogLevel__System_Net_Http_HttpClient"
"Logging__LogLevel__MyCompany_MyProduct_MyComponent"

What is the correct way to configure that kind of variable in Linux?

Juan Zamudio
  • 373
  • 11
  • 35
  • How are you setting the environment variable? – DavidG Sep 02 '21 at 21:08
  • You gave us two C# statements and said that they worked in Windows. Then you said you weren't successful in Linux, and gave us two pairs of strings; these are not C# statements, and it's not clear to me where you are copying them from or what they are supposed to be demonstrating. Can you edit your post to explain that? And, more importantly, can you edit your post to elaborate on what "doesn't work" means? Does it mean the environment variables are not set? Does it mean your custom component fails to read them? Something else? – Noah Sep 02 '21 at 22:11
  • Are you saying that the environment variables are being created with underscores in place of periods? That may have to do with [Linux naming conventions](https://stackoverflow.com/questions/2821043/allowed-characters-in-linux-environment-variable-names). – Noah Sep 02 '21 at 22:22
  • @DavidG we are using cloud formation to deploy a lambda – Juan Zamudio Sep 02 '21 at 22:24
  • @Noah Those were examples of the values that work and does not work for us, not about how are we setting them, in our CI/CD we set those values using cloud formation, for testing we are setting the values in the configuration tab in the AWS page – Juan Zamudio Sep 02 '21 at 22:27

0 Answers0