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

Add logger level configuration support #551

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

siberianlove
Copy link
Contributor

Based on issue: #140

When my redmine log storage was low i was looking for log rotation solution for my redmine instance and discovered that it has one out of the box: https://github.com/search?q=repo%3Asameersbn%2Fdocker-redmine%20logrotate&type=code

It's just my instance generated so much info logs by default. So it'l be great if administrators can configure amount of generated logs but in this repo i didn't found any solution for configuring logger level so i implemented it.

Tested on my instance.

Thx for the great repo by the way! When i discovered this repo it became a lot easier to administrate redmine.

echo "config.action_controller.perform_caching = true"
echo "config.cache_classes = true"
echo "config.cache_store = :mem_cache_store, ${MEMCACHE_HOST}:${MEMCACHE_PORT}"
} >> "${REDMINE_MEMCACHED_CONFIG}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this file is pulling double duty, can we rename REDMINE_MEMCACHED_CONFIG to REDMINE_ADDITIONAL_CONFIG

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

fi
}

redmine_configure_logger() {
echo "Configuring redmine::logger..."
echo "config.log_level = :${LOGGER_LEVEL:-info}" >> "${REDMINE_MEMCACHED_CONFIG}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also put the LOGGER_LEVEL default in env-defaults so its consistent with the other settings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@jcormier jcormier merged commit 9586049 into sameersbn:master Apr 4, 2024
1 check passed
@jcormier
Copy link
Collaborator

jcormier commented Apr 4, 2024

Thanks

@jcormier jcormier self-assigned this Apr 4, 2024
echo "config.gem 'dalli'"
echo "config.action_controller.perform_caching = true"
echo "config.cache_classes = true"
echo "config.cache_store = :mem_cache_store, ${MEMCACHE_HOST}:${MEMCACHE_PORT}"

Choose a reason for hiding this comment

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

There is a regression in this line - unquoted string in config file throws error:

bundler: failed to load command: unicorn_rails (/home/redmine/redmine/vendor/bundle/ruby/3.2.0/bin/unicorn_rails)
/home/redmine/redmine/config/application.rb:97:in `instance_eval': (eval):14: syntax error, unexpected label (SyntaxError)
... = :mem_cache_store, memcached:11211
...                     ^~~~~~~~~~

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks I'll get that fixed

Copy link
Collaborator

Choose a reason for hiding this comment

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

pushed commit to master branch, can you test and let me know before I push a new tag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants