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: allow to customize logs dir through environment variable #2396

Merged
merged 1 commit into from Dec 27, 2023
Merged

feat: allow to customize logs dir through environment variable #2396

merged 1 commit into from Dec 27, 2023

Conversation

nikaro
Copy link
Contributor

@nikaro nikaro commented Dec 27, 2023

Allow to customize log directory through K9S_LOGS_DIR environment variable.
If not set, fallsback on default tmp directory.

Fixes #2394

Copy link
Owner

@derailed derailed left a comment

Choose a reason for hiding this comment

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

@nikaro Thank you for this update Nicolas!
We should update the docs as well given we're introducing a new env var.

internal/config/files.go Outdated Show resolved Hide resolved
Allow to customize log directory through `K9S_LOGS_DIR` environment variable.
If not set, fallsback on default tmp directory.

Fixes #2394
Comment on lines +321 to +336
### Customize logs destination

You can override the default log file destination either with the `--logFile` argument:

```shell
k9s --logFile /tmp/k9s.log
less /tmp/k9s.log
```

Or through the `K9S_LOGS_DIR` environment variable:

```shell
K9S_LOGS_DIR=/var/log k9s
less /var/log/k9s.log
```

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@derailed is it good for you? Is it also the right place?

Copy link
Owner

Choose a reason for hiding this comment

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

@nikaro Brilliant! Thanks for the updates Nicolas!

Copy link
Owner

@derailed derailed left a comment

Choose a reason for hiding this comment

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

@nikaro Thank you for the updates!

@derailed derailed merged commit 736f6bf into derailed:master Dec 27, 2023
3 checks passed
@nikaro nikaro deleted the feat/configurabe-tmp branch December 27, 2023 23:18
@derailed derailed mentioned this pull request Dec 28, 2023
thejoeejoee pushed a commit to thejoeejoee/k9s that referenced this pull request Feb 23, 2024
…led#2396)

Allow to customize log directory through `K9S_LOGS_DIR` environment variable.
If not set, fallsback on default tmp directory.

Fixes derailed#2394
placintaalexandru pushed a commit to placintaalexandru/k9s that referenced this pull request Apr 3, 2024
…led#2396)

Allow to customize log directory through `K9S_LOGS_DIR` environment variable.
If not set, fallsback on default tmp directory.

Fixes derailed#2394
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.

Allow setting custom log dir
2 participants