Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli.rs): allow setting app log dir via SPIN_LOG_DIR env var #2209

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

vdice
Copy link
Contributor

@vdice vdice commented Jan 3, 2024

  • Allows setting the app's log directory via an SPIN_LOG_DIR env var

Unsure if it was an intentional decision to not allow setting via env var, though?

I happened to notice this when deploying to the OSS Fermyon Platform, using Hippo, which attempts to set this env var: https://github.com/deislabs/hippo/blob/main/src/Infrastructure/Services/NomadJobService.cs#L189

@@ -43,6 +43,7 @@ where
#[clap(
name = APP_LOG_DIR,
short = 'L',
env = APP_LOG_DIR,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For an environment variable I'd consider SPIN_LOG_DIR (as Hippo used) rather than APP_LOG_DIR. Reduces the risk of a clash, and makes it easier for someone poring through the environment to understand what the variable relates to.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(to be clear APP_LOG_DIR is fine for the name because that only gets used when printing help strings, at which point the user is strictly in the context of spin up... I am just wary of it as a name in the global environment)

@vdice vdice force-pushed the feat/app-log-dir-env branch from dcb4e37 to 179fa36 Compare January 3, 2024 21:03
Signed-off-by: Vaughn Dice <vaughn.dice@fermyon.com>
@vdice vdice force-pushed the feat/app-log-dir-env branch from 179fa36 to 2c5b190 Compare January 3, 2024 21:04
@vdice vdice changed the title feat(cli.rs): allow setting app log dir via APP_LOG_DIR env var feat(cli.rs): allow setting app log dir via SPIN_LOG_DIR env var Jan 3, 2024
@vdice vdice merged commit 2c44554 into spinframework:main Jan 3, 2024
11 checks passed
@vdice vdice deleted the feat/app-log-dir-env branch January 3, 2024 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants