aboutsummaryrefslogtreecommitdiffstats
path: root/python/task_server/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/task_server/__init__.py')
-rw-r--r--python/task_server/__init__.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/python/task_server/__init__.py b/python/task_server/__init__.py
index e37fff73..244f6f34 100644
--- a/python/task_server/__init__.py
+++ b/python/task_server/__init__.py
@@ -1,17 +1,13 @@
+from env import DAILY_DIR
from flask import Flask
-from pathlib import Path
+from utils import SerenitasFileHandler
+
app = Flask(__name__)
import logging
-import os
-
-LOG_DIR = Path(os.environ["LOG_DIR"])
-DAILY_DIR = Path(os.environ["DAILY_DIR"])
-fh = logging.FileHandler(filename=LOG_DIR / 'tasks.log')
-formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
-fh.setFormatter(formatter)
-loggers = [logging.getLogger('intex'), app.logger, logging.getLogger(__name__)]
+fh = SerenitasFileHandler("tasks.log")
+loggers = [logging.getLogger("intex"), app.logger, logging.getLogger(__name__)]
for logger in loggers:
logger.setLevel(logging.INFO)