-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
Add log output config option #172
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jahands
commented
Dec 15, 2023
for _, logOutputType := range logOutputTypes { | ||
logOutputType = strings.TrimSpace(logOutputType) | ||
if !utils.SliceContains([]string{"stdout", "file"}, logOutputType) { | ||
defer func() { log.Warn().Msg("Invalid log output type: " + logOutputType) }() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used defer for these logs so that they get logged after the logger is initialized
jahands
commented
Dec 27, 2023
@@ -5,6 +5,9 @@ | |||
# Set the log level to one of the following: trace, debug, info, warn, error, fatal, panic. Default: warn | |||
log-level: warn | |||
|
|||
# Set the log output to one or more of the following: `stdout`, `file`. Default: stdout,file | |||
log-output: stdout,file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed this, thanks
Thanks for the feature! |
thomiceli
added a commit
that referenced
this pull request
Jan 4, 2024
Co-authored-by: Thomas Miceli <27960254+thomiceli@users.noreply.github.com>
jiriks74
pushed a commit
to jiriks74/opengist
that referenced
this pull request
Apr 28, 2024
Co-authored-by: Thomas Miceli <27960254+thomiceli@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm hosting Opengist in Docker, with stdout logs being sent to Axiom, and didn't want the log file taking up disk space.
This adds a new config option:
log-output
(OG_LOG_OUTPUT
) that takes a comma-separated list of outputs (stdout
andfile
are supported.)Testing: