Update configuration.py to use LOGGING environment variable #299
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.
Update configuration.py to use a LOGGING environment variable to allow LOGGING configuration to be set via docker-compose.
LOGGING environment variable should be set to the full dictionary - example below:
LOGGING: "{'version': 1, 'disable_existing_loggers': False, 'formatters': { 'timestamp': { 'format': '{asctime} {levelname} {message}', 'style': '{', }, }, 'handlers': { 'netbox-auth': { 'level': 'DEBUG', 'class': 'logging.FileHandler', 'formatter': 'timestamp', 'filename': '/var/log/netbox/netbox-auth.log', }, 'netbox': { 'level': 'DEBUG', 'class': 'logging.FileHandler', 'formatter': 'timestamp', 'filename': '/var/log/netbox/netbox.log', }, }, 'loggers': { 'netbox.auth': { 'handlers': ['netbox-auth'], 'level': 'DEBUG', }, 'django_auth_ldap': { 'handlers': ['netbox-auth'], 'level': 'DEBUG', }, 'netbox.views': { 'handlers': ['netbox'], 'level': 'DEBUG', }, 'netbox.api.views': { 'handlers': ['netbox'], 'level': 'DEBUG', }, },}"
Related Issue: None
New Behavior
Allows an environment variable to get set within docker-compose that contains the custom LOGGING configuration.
...
Contrast to Current Behavior
Currently these changes have to be made to the configuration.py file, instead of being configurable via the docker-compose.overrides.yml file.
...
Discussion: Benefits and Drawbacks
By adding this change it enables much simpler upgrades, all configuration is in a single place (the docker-compose.overrides.yml file), which means when an upgrade is available a simple pull of the latest codebase is all thats required.
...
Changes to the Wiki
...
Proposed Release Note Entry
Enable logging configuration to be set via docker-compose environment variable.
...
Double Check
develop
branch.