Samples¶
The following sections show sample configuration files for monasca-api and related utilities. These are generated from the code (apart from the samples for logging and paster) and reflect the current state of code in the monasca-api repository.
Sample Configuration For Application¶
This sample configuration can also be viewed in monasca-api.conf.sample.
[DEFAULT]
Sample Configuration For Logging¶
This sample configuration can also be viewed in api-logging.conf.
[loggers]
keys = root, sqlalchemy, kafka, kafkalib
[handlers]
keys = console, file
[formatters]
keys = context
[logger_root]
level = DEBUG
handlers = console, file
[logger_sqlalchemy]
qualname = sqlalchemy.engine
# "level = INFO" logs SQL queries.
# "level = DEBUG" logs SQL queries and results.
# "level = WARN" logs neither. (Recommended for production systems.)
level = DEBUG
handlers = console, file
propagate=0
[logger_kafka]
qualname = kafka
level = DEBUG
handlers = console, file
propagate = 0
[logger_kafkalib]
qualname = monasca_common.kafka_lib
level = INFO
handlers = console, file
propagate = 0
[handler_console]
class = logging.StreamHandler
args = (sys.stderr,)
level = DEBUG
formatter = context
[handler_file]
class = logging.handlers.RotatingFileHandler
level = DEBUG
formatter = context
# store up to 5*100MB of logs
args = ('/var/log/monasca/api/monasca-api.log', 'a', 104857600, 5)
[formatter_context]
class = oslo_log.formatters.ContextFormatter
Sample Configuration For Paster¶
This sample configuration can also be viewed in api-config.ini.
[DEFAULT]
name = monasca_api
[pipeline:main]
pipeline = request_id auth api
[app:api]
paste.app_factory = monasca_api.api.server:launch
[filter:auth]
paste.filter_factory = monasca_api.healthcheck.keystone_protocol:filter_factory
[filter:request_id]
paste.filter_factory = oslo_middleware.request_id:RequestId.factory
[server:main]
use = egg:gunicorn#main
host = 127.0.0.1
port = 8070
workers = 9
worker-connections = 2000
worker-class = eventlet
timeout = 30
backlog = 2048
keepalive = 2
proc_name = monasca-api
loglevel = DEBUG