Skip to content

Commit

Permalink
REFACTO logfile path
Browse files Browse the repository at this point in the history
  • Loading branch information
TOUL committed Jun 28, 2023
1 parent 5b6006a commit ca6050a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions config/monitoring_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@

if ENVIRONMENT == EnvironmentType.local:
DB_CONNECTION_STRING = 'sqlite:///monitoring.db'
API_LOGFILE_LOG = "api_logfile.log"
else:
DB_CONNECTION_STRING = 'postgresql://postgres:postgres@postgres:5432/postgres'
API_LOGFILE_LOG = "/home/jovyan/api_logfile.log"
4 changes: 2 additions & 2 deletions source/api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from fastapi import FastAPI

from config.api_server import SERVER_ADRESS
from config.monitoring_config import DB_CONNECTION_STRING
from config.monitoring_config import DB_CONNECTION_STRING, API_LOGFILE_LOG
from source.domain.entities.customer_columns import DataSetColumns
from source.domain.usecase.monitor import monitor
from source.domain.usecase.predict_model import predict_model, INFERENCE_COL
Expand All @@ -14,7 +14,7 @@

logger = logging.getLogger("uvicorn")
logger.setLevel(logging.INFO)
handler = logging.FileHandler("/home/jovyan/api_logfile.log")
handler = logging.FileHandler(API_LOGFILE_LOG)
logger.addHandler(handler)

app = FastAPI(root_path=SERVER_ADRESS)
Expand Down

0 comments on commit ca6050a

Please sign in to comment.