Configure nodepool to use logging config
We have a logging config to log to /var/log/nodepool but we weren't using it. Start using it. Add logging config to nodepool-builder We should log nodepool builder to /var/log/nodepool too. Change-Id: I6e7196dc12e8c1bfc54274432b94cf53629bdf3d
This commit is contained in:
parent
e56cbdcee3
commit
8b1b70c77e
@ -25,6 +25,14 @@
|
||||
group: nodepool
|
||||
mode: 0755
|
||||
|
||||
- name: Create nodepool log dir
|
||||
file:
|
||||
name: /var/log/nodepool
|
||||
state: directory
|
||||
owner: nodepool
|
||||
group: nodepool
|
||||
mode: 0755
|
||||
|
||||
- name: Look for a host specific config file
|
||||
stat:
|
||||
path: /opt/project-config/nodepool/{{ inventory_hostname }}.yaml
|
||||
|
55
playbooks/roles/nodepool-builder/files/logging.conf
Normal file
55
playbooks/roles/nodepool-builder/files/logging.conf
Normal file
@ -0,0 +1,55 @@
|
||||
[loggers]
|
||||
keys=root,nodepool,requests,openstack,kazoo
|
||||
|
||||
[handlers]
|
||||
keys=console,debug,normal
|
||||
|
||||
[formatters]
|
||||
keys=simple
|
||||
|
||||
[logger_root]
|
||||
level=WARNING
|
||||
handlers=console
|
||||
|
||||
[logger_requests]
|
||||
level=WARNING
|
||||
handlers=debug,normal
|
||||
qualname=requests
|
||||
|
||||
[logger_openstack]
|
||||
level=WARNING
|
||||
handlers=debug,normal
|
||||
qualname=openstack
|
||||
|
||||
[logger_nodepool]
|
||||
level=DEBUG
|
||||
handlers=debug,normal
|
||||
qualname=nodepool
|
||||
|
||||
[logger_kazoo]
|
||||
level=INFO
|
||||
handlers=debug,normal
|
||||
qualname=kazoo
|
||||
propagate=0
|
||||
|
||||
[handler_console]
|
||||
level=WARNING
|
||||
class=StreamHandler
|
||||
formatter=simple
|
||||
args=(sys.stdout,)
|
||||
|
||||
[handler_debug]
|
||||
level=DEBUG
|
||||
class=logging.handlers.TimedRotatingFileHandler
|
||||
formatter=simple
|
||||
args=('/var/log/nodepool/builder-debug.log', 'H', 8, 30,)
|
||||
|
||||
[handler_normal]
|
||||
level=INFO
|
||||
class=logging.handlers.TimedRotatingFileHandler
|
||||
formatter=simple
|
||||
args=('/var/log/nodepool/nodepool-builder.log', 'H', 8, 30,)
|
||||
|
||||
[formatter_simple]
|
||||
format=%(asctime)s %(levelname)s %(name)s: %(message)s
|
||||
datefmt=
|
@ -1,3 +1,8 @@
|
||||
- name: Copy logging config
|
||||
copy:
|
||||
src: logging.conf
|
||||
dest: /etc/nodepool/builder-logging.conf
|
||||
|
||||
- name: Ensure dib directories
|
||||
file:
|
||||
state: directory
|
||||
|
@ -5,6 +5,7 @@ services:
|
||||
user: nodepool
|
||||
network_mode: host
|
||||
restart: always
|
||||
command: nodepool-builder -c /etc/nodepool/nodepool.yaml -l /etc/nodepool/builder-logging.conf
|
||||
|
||||
privileged: true
|
||||
|
||||
|
@ -5,6 +5,7 @@ services:
|
||||
user: nodepool
|
||||
network_mode: host
|
||||
restart: always
|
||||
command: nodepool-launcher -c /etc/nodepool/nodepool.yaml -l /etc/nodepool/launcher-logging.conf
|
||||
|
||||
environment:
|
||||
- DEBUG=1
|
||||
|
Loading…
Reference in New Issue
Block a user