Setup events logging from settings.

This commit is contained in:
Arik Fraimovich 2014-04-10 13:02:40 +03:00
parent 8615429e0c
commit 6d62f0d2c9
2 changed files with 6 additions and 0 deletions

View File

@ -7,6 +7,7 @@ from flask_peewee.db import Database
import redis
from statsd import StatsClient
import events
from redash import settings, utils
__version__ = '0.3.6'
@ -19,6 +20,9 @@ def setup_logging():
logging.getLogger().addHandler(handler)
logging.getLogger().setLevel(settings.LOG_LEVEL)
if settings.EVENTS_LOG_PATH:
events.setup_logging(settings.EVENTS_LOG_PATH, settings.EVENTS_CONSOLE_OUTPUT)
setup_logging()
app = Flask(__name__,

View File

@ -65,4 +65,6 @@ STATIC_ASSETS_PATH = fix_assets_path(os.environ.get("REDASH_STATIC_ASSETS_PATH",
WORKERS_COUNT = int(os.environ.get("REDASH_WORKERS_COUNT", "2"))
COOKIE_SECRET = os.environ.get("REDASH_COOKIE_SECRET", "c292a0a3aa32397cdb050e233733900f")
LOG_LEVEL = os.environ.get("REDASH_LOG_LEVEL", "INFO")
EVENTS_LOG_PATH = os.environ.get("REDASH_EVENTS_LOG_PATH", "")
EVENTS_CONSOLE_OUTPUT = parse_boolean(os.environ.get("REDASH_EVENTS_CONSOLE_OUTPUT", "false"))
ANALYTICS = os.environ.get("REDASH_ANALYTICS", "")