Allow different log level for django module

This change introduces a new parameter to determine log level of
the django module. Debug log from this module is known to be quite
verbose though most of them are warning caused by implementation and
not useful for operators. Adding a new parameter allows enabling debug
for all modules except for the django module.

Change-Id: Ice284786f9b34f328ff72e8d5a50dff03b827f73
This commit is contained in:
Takashi Kajinami 2022-03-25 01:30:35 +09:00
parent c777b11f68
commit 38d7c1849c
3 changed files with 17 additions and 3 deletions

View File

@ -130,8 +130,13 @@
# (optional) Log handlers. Defaults to ['file']
#
# [*log_level*]
# (optional) Log level. Defaults to 'INFO'. WARNING: Setting this to
# DEBUG will let plaintext passwords be logged in the Horizon log file.
# (optional) Log level. WARNING: Setting this to DEBUG will let plaintext
# passwords be logged in the Horizon log file.
# Defaults to 'INFO'
#
# [*django_log_level*]
# (optional) Log level of django module. This overrides log_level.
# Defaults to undef
#
# [*syslog_facility*]
# (optional) Syslog facility used when syslog log hander is enabled.
@ -566,6 +571,7 @@ class horizon(
$dropdown_max_items = 30,
$log_handlers = ['file'],
$log_level = 'INFO',
$django_log_level = undef,
$syslog_facility = 'local1',
$help_url = 'http://docs.openstack.org',
$local_settings_template = 'horizon/local_settings.py.erb',
@ -741,6 +747,8 @@ and usage of a quoted value is deprecated.')
})
}
$django_log_level_real = pick($django_log_level, $log_level)
package { 'horizon':
ensure => $package_ensure,
name => $::horizon::params::package_name,

View File

@ -0,0 +1,6 @@
---
features:
- |
The new ``horizon::django_log_level`` parameter has been added. This
parameter determines log level of the django module and overrides
the global ``log_level`` parameter.

View File

@ -843,7 +843,7 @@ LOGGING = {
# 'handlers': ['console'],
'handlers': ['<%= @log_handlers.join("', '") %>'],
# 'level': 'DEBUG',
'level': '<%= @log_level %>',
'level': '<%= @django_log_level_real %>',
'propagate': False,
},
# Logging from django.db.backends is VERY verbose, send to null