Fix broken logging

Allow-us to log to files.

Change-Id: I6864a7968967be6362d142b3d7ffee74abce9dc2
This commit is contained in:
Frédéric Guillot 2017-01-12 16:22:54 -05:00
parent 308a04d678
commit 53812aeb40
3 changed files with 12 additions and 9 deletions

View File

@ -12,16 +12,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from flask import Flask
from oslo_log import log
import sys
from flask import Flask
from oslo_log import log as logging
from almanach.api import auth_adapter
from almanach.api.v1 import routes
from almanach.core import factory as core_factory
from almanach.core import opts
LOG = log.getLogger(__name__)
LOG = logging.getLogger(__name__)
app = Flask('almanach')
app.register_blueprint(routes.api)
@ -29,7 +30,8 @@ app.register_blueprint(routes.api)
def main():
try:
opts.CONF(sys.argv[1:])
opts.CONF(sys.argv[1:], project=opts.DOMAIN)
logging.setup(opts.CONF, opts.DOMAIN)
config = opts.CONF
factory = core_factory.Factory(config)

View File

@ -12,19 +12,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from oslo_log import log
from oslo_service import service
import sys
from oslo_log import log as logging
from oslo_service import service
from almanach.collector import service as collector_service
from almanach.core import factory as core_factory
from almanach.core import opts
LOG = log.getLogger(__name__)
LOG = logging.getLogger(__name__)
def main():
opts.CONF(sys.argv[1:])
opts.CONF(sys.argv[1:], project=opts.DOMAIN)
logging.setup(opts.CONF, opts.DOMAIN)
config = opts.CONF
service_factory = collector_service.ServiceFactory(config, core_factory.Factory(config))

View File

@ -107,7 +107,6 @@ CONF.register_opts(keystone_opts, group='keystone_authtoken')
CONF.register_opts(entity_opts, group='entities')
logging.register_options(CONF)
logging.setup(CONF, DOMAIN)
def list_opts():