mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 20:46:47 +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
|
# Get a logger instance for this setup file
|
||||||
logger = logging.getLogger("inventree")
|
logger = logging.getLogger("inventree")
|
||||||
|
|
||||||
|
@ -69,6 +69,10 @@ debug: True
|
|||||||
# Options: DEBUG / INFO / WARNING / ERROR / CRITICAL
|
# Options: DEBUG / INFO / WARNING / ERROR / CRITICAL
|
||||||
log_level: WARNING
|
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')
|
# Select default system language (default is 'en-us')
|
||||||
# Use the environment variable INVENTREE_LANGUAGE
|
# Use the environment variable INVENTREE_LANGUAGE
|
||||||
language: en-us
|
language: en-us
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
# Set DEBUG to True for a development setup
|
# Set DEBUG to True for a development setup
|
||||||
INVENTREE_DEBUG=True
|
INVENTREE_DEBUG=True
|
||||||
INVENTREE_LOG_LEVEL=INFO
|
INVENTREE_LOG_LEVEL=INFO
|
||||||
|
INVENTREE_DB_LOGGING=False
|
||||||
|
|
||||||
# Database configuration options
|
# Database configuration options
|
||||||
# Note: The example setup is for a PostgreSQL database (change as required)
|
# 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_DEBUG | debug | Enable [debug mode](./intro.md#debug-mode) | True |
|
||||||
| INVENTREE_LOG_LEVEL | log_level | Set level of logging to terminal | WARNING |
|
| 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 |
|
| INVENTREE_TIMEZONE | timezone | Server timezone | UTC |
|
||||||
| ADMIN_URL | admin_url | URL for accessing [admin interface](../settings/admin.md) | admin |
|
| ADMIN_URL | admin_url | URL for accessing [admin interface](../settings/admin.md) | admin |
|
||||||
| INVENTREE_LANGUAGE | language | Default language | en-us |
|
| INVENTREE_LANGUAGE | language | Default language | en-us |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user