I am using logtail.com and for some reason it wont log ONLY in my FastAPI/UVICORN app, I tried using the package in an a different test python file and it worked? I dont understand what I am missing. I call the logger and it should work but it does not, additionally I even do a log INSTANTLY after I instantiate the logger and it does not work. Code below.
#
# Logger.py
#
from logtail import LogtailHandler
import logging
class Logger:
    def __init__(self):
        handler = LogtailHandler(source_token="XXXXXXX")
        logger = logging.getLogger(__name__)
        logger.handlers = []
        logger.setLevel(logging.DEBUG) # Set minimal log level
        logger.addHandler(handler) # asign handler to logger
        logger.debug('I am using Logtail!')
    def info(self, message):
        self.log.info(message)
        
    def error(self, message):
        self.log.error(message)
    
    def debug(self, message):
        self.log.debug(message)
        
    def warning(self, message):
        self.log.warning(message)
        
    def critical(self, message):
        self.log.critical(message)
        
    def exception(self, message):
        self.log.exception(message)
#
# __init__ 
#
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from abe.routes import main, bc_handler
app = FastAPI(title="ABE-Backend", openapi_url="/openapi.json")
app.include_router(main.router)
app.include_router(bc_handler.router)
from abe.utils.logger import Logger
logger = Logger()
#create tables
# models.Base.metadata.create_all(bind=engine)
origins = [
    
]
app.add_middleware(
    CORSMiddleware,
    allow_origins=origins,
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)
if __name__ == "__main__":
    # Use this for debugging purposes only
    import uvicorn
    uvicorn.run(app, host="0.0.0.0", port=8000, log_level="debug")
    logger.info("Starting server on port 8000, with cors origins: "+str(origins))
 
     
     
    