Feature: Make LOG_LEVEL configurable #194
Open
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.
Summary
This PR introduces configurable logging levels to enhance flexibility and reduce unnecessary log output in production environments. The default log level remains
INFO
, ensuring backward compatibility.Background
While running
fusion
in a Docker container, I observed excessive log growth due to the defaultINFO
logging level. This can lead to storage concerns in long-running production deployments where verbose logs are unnecessary. Currently, the application does not support log level configuration, limiting users' ability to control log output.Changes
LOG_LEVEL
environment variableINFO
as the default level when:LOG_LEVEL
is unsetDEBUG
INFO
WARN
(orWARNING
)ERROR
Configuration
The log level can be configured through:
-e
flag)Example Docker command:
docker run --rm -it -d -p 9080:8080 -e PASSWORD="fusion" -e LOG_LEVEL=ERROR your_image_id
Example (Before implementing configurable log level)
this is the sample of my container's log after running the app for the first time, log in and then refreshing the feed several times
Example (After implementing configurable log level)
After the feature has been made, I run the app using docker and set the
LOG_LEVEL
value using this command:docker run --rm -it -d -p 9080:8080 -e PASSWORD="fusion" -e LOG_LEVEL=ERROR aac4f28d8385
, log in and then refresh the feed several times. Below are the output log on my containerAny feedback to better improve this PR is appreciated