add gunicorn logging, GUNICORN to config.py
This commit is contained in:
parent
444601dab8
commit
22b4ee68d9
|
@ -1,4 +1,5 @@
|
||||||
import os
|
import os
|
||||||
|
import logging
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
from apscheduler.schedulers.background import BackgroundScheduler
|
from apscheduler.schedulers.background import BackgroundScheduler
|
||||||
from tlapbot.db import get_db
|
from tlapbot.db import get_db
|
||||||
|
@ -24,6 +25,12 @@ def create_app(test_config=None):
|
||||||
app.config.from_pyfile('config.py', silent=True)
|
app.config.from_pyfile('config.py', silent=True)
|
||||||
app.config.from_pyfile('redeems.py', silent=True)
|
app.config.from_pyfile('redeems.py', silent=True)
|
||||||
|
|
||||||
|
# Make logging work for gunicorn-ran instances of tlapbot.
|
||||||
|
if app.config['GUNICORN'] is True:
|
||||||
|
gunicorn_logger = logging.getLogger('gunicorn.error')
|
||||||
|
app.logger.handlers = gunicorn_logger.handlers
|
||||||
|
app.logger.setLevel(gunicorn_logger.level)
|
||||||
|
|
||||||
# prepare webhooks and redeem dashboard blueprints
|
# prepare webhooks and redeem dashboard blueprints
|
||||||
from . import owncast_webhooks
|
from . import owncast_webhooks
|
||||||
from . import owncast_redeem_dashboard
|
from . import owncast_redeem_dashboard
|
||||||
|
|
|
@ -4,3 +4,4 @@ OWNCAST_INSTANCE_URL='http://localhost:8080'
|
||||||
POINTS_CYCLE_TIME=600
|
POINTS_CYCLE_TIME=600
|
||||||
POINTS_AMOUNT_GIVEN=10
|
POINTS_AMOUNT_GIVEN=10
|
||||||
LIST_REDEEMS=False
|
LIST_REDEEMS=False
|
||||||
|
GUNICORN=False
|
Loading…
Reference in New Issue