Open jymchng opened 1 year ago
@jymchng I think you should do something like this
import logging
from fastapi import FastAPI
app = FastAPI()
logger = logging.getLogger(__name__)
log_handler = logging.FileHandler(filename="app.log")
logger.addHandler(log_handler)
@app.get("/")
async def root():
logger.info("Received request at root endpoint")
return {"message": "Hello World"}
How about storing the logs in minio?
How about storing the logs in minio?
@jonra1993 Sir, what do you think of this?
Hello @jymchng I do not think any reason why it should not work I I am going to add it to todo list.
Hi @jonra1993,
I am using
logger = logging.getLogger(__name__)
to do my logging atDEBUG
level.How do I dump these logs daily to disk? Thank you.