# Set enviroment variables

**URL:** <https://forum.litium.com/t/set-enviroment-variables/1607>\
**Category:** Questions\
**Tags:** litium-7\
**Created:** [August 25, 2020, 6:29am UTC](https://forum.litium.com/t/set-enviroment-variables/1607 "2020-08-25T06:29:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Artur](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/artur/32/948_2.png) [@Artur](https://forum.litium.com/u/Artur)\
**Post date:** [August 25, 2020, 6:29am UTC](https://forum.litium.com/t/set-enviroment-variables/1607/1 "2020-08-25T06:29:10Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [August 25, 2020, 6:46am UTC](https://forum.litium.com/t/set-enviroment-variables/1607/2 "2020-08-25T06:46:54Z")

</div>

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](https://github.com/googleapis/google-cloud-dotnet/tree/master/apis/Google.Cloud.Logging.NLog/Google.Cloud.Logging.NLog#target-options) for the properties reference.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)\
**Post date:** [September 22, 2020, 6:46am UTC](https://forum.litium.com/t/set-enviroment-variables/1607/3 "2020-09-22T06:46:55Z")

</div>

Closed on September 22, 2020, 6:46am UTC

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