Permit local configuration of Django LOGGING #791

Closed
opened 2025-12-29 16:25:51 +01:00 by adam · 1 comment
Owner

Originally created by @ktims on GitHub (Mar 23, 2017).

It would be useful to permit local configuration of the Django LOGGING setting. Currently if custom LOGGING is desired, it must be configured in settings.py, but this is part of the distribution. Simple change, as the facility to import local settings is already there.

diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py
index ae81d26..c1daf42 100644
--- a/netbox/netbox/settings.py
+++ b/netbox/netbox/settings.py
@@ -15,7 +15,7 @@ except ImportError:
 VERSION = '1.9.3'
 
 # Import local configuration
-for setting in ['ALLOWED_HOSTS', 'DATABASE', 'SECRET_KEY']:
+for setting in ['ALLOWED_HOSTS', 'DATABASE', 'SECRET_KEY', 'LOGGING']:
     try:
         globals()[setting] = getattr(configuration, setting)
     except AttributeError:
Originally created by @ktims on GitHub (Mar 23, 2017). It would be useful to permit local configuration of the Django `LOGGING` setting. Currently if custom LOGGING is desired, it must be configured in `settings.py`, but this is part of the distribution. Simple change, as the facility to import local settings is already there. ```patch diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index ae81d26..c1daf42 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -15,7 +15,7 @@ except ImportError: VERSION = '1.9.3' # Import local configuration -for setting in ['ALLOWED_HOSTS', 'DATABASE', 'SECRET_KEY']: +for setting in ['ALLOWED_HOSTS', 'DATABASE', 'SECRET_KEY', 'LOGGING']: try: globals()[setting] = getattr(configuration, setting) except AttributeError: ```
adam added the type: feature label 2025-12-29 16:25:51 +01:00
adam closed this issue 2025-12-29 16:25:51 +01:00
Author
Owner

@jeremystretch commented on GitHub (Mar 27, 2017):

FYI the code above would make LOGGING a mandatory setting, which is not what we want.

@jeremystretch commented on GitHub (Mar 27, 2017): FYI the code above would make `LOGGING` a mandatory setting, which is not what we want.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#791