mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Adds optional config setting to enable database level logging (#5617)
This commit is contained in:
parent
67b2d02a7f
commit
dad240529d
@ -109,6 +109,14 @@ LOGGING = {
|
||||
},
|
||||
}
|
||||
|
||||
# Optionally add database-level logging
|
||||
if get_setting('INVENTREE_DB_LOGGING', 'db_logging', False):
|
||||
LOGGING['loggers'] = {
|
||||
'django.db.backends': {
|
||||
'level': log_level or 'DEBUG',
|
||||
},
|
||||
}
|
||||
|
||||
# Get a logger instance for this setup file
|
||||
logger = logging.getLogger("inventree")
|
||||
|
||||
|
@ -69,6 +69,10 @@ debug: True
|
||||
# Options: DEBUG / INFO / WARNING / ERROR / CRITICAL
|
||||
log_level: WARNING
|
||||
|
||||
# Enable database-level logging
|
||||
# Use the environment variable INVENTREE_DB_LOGGING
|
||||
db_logging: False
|
||||
|
||||
# Select default system language (default is 'en-us')
|
||||
# Use the environment variable INVENTREE_LANGUAGE
|
||||
language: en-us
|
||||
|
@ -4,6 +4,7 @@
|
||||
# Set DEBUG to True for a development setup
|
||||
INVENTREE_DEBUG=True
|
||||
INVENTREE_LOG_LEVEL=INFO
|
||||
INVENTREE_DB_LOGGING=False
|
||||
|
||||
# Database configuration options
|
||||
# Note: The example setup is for a PostgreSQL database (change as required)
|
||||
|
@ -53,6 +53,7 @@ The following basic options are available:
|
||||
| --- | --- | --- | --- |
|
||||
| INVENTREE_DEBUG | debug | Enable [debug mode](./intro.md#debug-mode) | True |
|
||||
| INVENTREE_LOG_LEVEL | log_level | Set level of logging to terminal | WARNING |
|
||||
| INVENTREE_DB_LOGGING | db_logging | Enable logging of database messages | False |
|
||||
| INVENTREE_TIMEZONE | timezone | Server timezone | UTC |
|
||||
| ADMIN_URL | admin_url | URL for accessing [admin interface](../settings/admin.md) | admin |
|
||||
| INVENTREE_LANGUAGE | language | Default language | en-us |
|
||||
|
Loading…
Reference in New Issue
Block a user