fixed logging

This commit is contained in:
2025-11-03 23:16:11 -05:00
parent 388c39973c
commit a141fa76f1
4 changed files with 32 additions and 13 deletions

View File

@@ -5,9 +5,13 @@ import transform
import load
import logging
from datetime import date, datetime
from dotenv import load_dotenv
logger = logging.getLogger('orchestrator.py')
logging.basicConfig(filename=os.getenv('LOG_FILE'), level=logging.INFO)
load_dotenv()
log_file = os.getenv('LOG_FILE')
logging.basicConfig(filename=log_file, level=logging.INFO)
logger = logging.getLogger('extract.py')
today = date.today()
@@ -39,4 +43,4 @@ if __name__ == '__main__':
os.remove(f'output/raw_google_books_{today}.json')
os.remove(f'output/raw_open_lib_books_{today}.json')
os.remove(f'output/transformed_{today}.json')
logger.info(f'{datetime.now()}:Orchestration complete. ETL Pipeline executed without errors.')
logger.info(f'{datetime.now()}:Orchestration complete. ETL Pipeline executed without errors.')