Delgan
Delgan
Ideally, you should group your logs into a single file instead of splitting them into five files. This should improve performance. If you want to view logs separately by level,...
One way would be to use `bind()` but that requires the added sink to have a `filter` based on the bounded name. Maybe you can use this workaround to create...
Yes, this is because of the multiple processes started by FastAPI. They won't inherit the `logger`, therefore the `enqueue=True` parameter is unfortunately ineffective. Right now, it's advised to use one...
Maybe these snippets can help you: * https://github.com/tiangolo/fastapi/issues/1276#issuecomment-615877177 * https://medium.com/1mgofficial/how-to-override-uvicorn-logger-in-fastapi-using-loguru-124133cdcd4e
After revisiting this ticket, I finally think combining Loguru and Gunicorn should work fine, provided the configuration is set up correctly. It turns out that Gunicorn starts its workers using...
Each time Uvicorn starts a new worker, a new process is spawned and the Python script is re-executed. This means `logger.add(sink=log_save_path)` is called multiple times in multiple processes. This is...
Hi. Could you provide the entire stack trace, including the type of exception reported in the error message please? Unfortunately, I'm unable to help you with the screen you've shared.
Hi @Serlonwann. It seems you simply need to delete the `self.logger.remove()` lines in the `__init__()` method of your classes. Calling `logger.remove()` will erase all previously installed handlers. That will lead...
The `enqueue=True` does not interoperate well with Gunicorn workers. This is because the workers does not inherit the `logger` from the parent process. For now, until a better solution is...
Actually, Loguru and Gunicorn should work fine together. The key point is to make sure that the `logger` is configured exactly once and in the master process (before the workers...