Set enviroment variables

Hi,

I’m trying to implement Google StackDriver for nlog. I need to set an environment variable for the json file as per documentation: https://cloud.google.com/docs/authentication/getting-started#windows

Is there a good way in Litium to set environment variables?
The startup seems to be compiled resource, any other ways i see is to use:

  1. StartupTask to create a task that reads from web.config or similar.
  2. Deployment to set during our CI

Has anyone solved this?

Litium version: 7.2.3

I think you should use the CredentialFile or CredentialJson target properties to point out the json or inlining the json directly in nlog.config instead of trying to get the environment variable set.

See https://github.com/googleapis/google-cloud-dotnet/tree/master/apis/Google.Cloud.Logging.NLog/Google.Cloud.Logging.NLog#target-options for the properties reference.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.