Added logging for horizon
This commit is contained in:
parent
49da02d3d7
commit
bcac7e1b60
@ -31,7 +31,8 @@ class horizon(
|
||||
$keystone_scheme = 'http',
|
||||
$keystone_default_role = 'Member',
|
||||
$django_debug = 'False',
|
||||
$api_result_limit = 1000
|
||||
$api_result_limit = 1000,
|
||||
$log_level = 'DEBUG'
|
||||
) {
|
||||
|
||||
include horizon::params
|
||||
@ -56,6 +57,15 @@ class horizon(
|
||||
notify => Service[$::horizon::params::http_service],
|
||||
require => Package[$::horizon::params::package_name],
|
||||
}
|
||||
|
||||
file { $::horizon::params::logdir:
|
||||
ensure => directory,
|
||||
mode => '0751',
|
||||
owner => $::horizon::params::apache_user,
|
||||
group => $::horizon::params::apache_group,
|
||||
before => Service[$::horizon::params::http_service],
|
||||
require => Package[$::horizon::params::package_name]
|
||||
}
|
||||
|
||||
file_line { 'horizon root':
|
||||
path => $::horizon::params::httpd_config_file,
|
||||
|
@ -2,6 +2,8 @@
|
||||
# should be considered to be constant
|
||||
class horizon::params {
|
||||
|
||||
$logdir = '/var/log/horizon'
|
||||
|
||||
case $::osfamily {
|
||||
'RedHat': {
|
||||
$http_service = 'httpd'
|
||||
@ -10,12 +12,16 @@ class horizon::params {
|
||||
$config_file = '/etc/openstack-dashboard/local_settings'
|
||||
$httpd_config_file = '/etc/httpd/conf.d/openstack-dashboard.conf'
|
||||
$root_url = '/dashboard'
|
||||
$apache_user = 'apache'
|
||||
$apache_group = 'apache'
|
||||
}
|
||||
'Debian': {
|
||||
$http_service = 'apache2'
|
||||
$config_file = '/etc/openstack-dashboard/local_settings.py'
|
||||
$httpd_config_file = '/etc/apache2/conf.d/openstack-dashboard.conf'
|
||||
$root_url = '/horizon'
|
||||
$apache_user = 'www-data'
|
||||
$apache_group = 'www-data'
|
||||
case $::operatingsystem {
|
||||
'Debian': {
|
||||
$package_name = 'openstack-dashboard-apache'
|
||||
|
@ -95,6 +95,11 @@ LOGGING = {
|
||||
'level': 'INFO',
|
||||
'class': 'logging.StreamHandler',
|
||||
},
|
||||
'file': {
|
||||
'level': '<%= log_level %>',
|
||||
'class': 'logging.FileHandler',
|
||||
'filename': '<%= scope.lookupvar("horizon::params::logdir") %>/horizon.log'
|
||||
},
|
||||
},
|
||||
'loggers': {
|
||||
# Logging from django.db.backends is VERY verbose, send to null
|
||||
@ -104,27 +109,27 @@ LOGGING = {
|
||||
'propagate': False,
|
||||
},
|
||||
'horizon': {
|
||||
'handlers': ['console'],
|
||||
'handlers': ['file'],
|
||||
'propagate': False,
|
||||
},
|
||||
'openstack_dashboard': {
|
||||
'handlers': ['console'],
|
||||
'handlers': ['file'],
|
||||
'propagate': False,
|
||||
},
|
||||
'novaclient': {
|
||||
'handlers': ['console'],
|
||||
'handlers': ['file'],
|
||||
'propagate': False,
|
||||
},
|
||||
'glanceclient': {
|
||||
'handlers': ['console'],
|
||||
'handlers': ['file'],
|
||||
'propagate': False,
|
||||
},
|
||||
'keystoneclient': {
|
||||
'handlers': ['console'],
|
||||
'handlers': ['file'],
|
||||
'propagate': False,
|
||||
},
|
||||
'nose.plugins.manager': {
|
||||
'handlers': ['console'],
|
||||
'handlers': ['file'],
|
||||
'propagate': False,
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user