TorchServe log retention

Hello,

what is the default retention policy for TorchServe logs?

Logs are stored inside “./logs” directory. Every day they are compressed and stored.
I was wondering what is the default retention policy for these logs, and if you can set a custom log expiration date?

If there is no log removal, after some time, logs will take up all free space and docker container will fail.

I am using TorchServe version 0.6.0

Thanks

Hi,

it seems that TorchServe doesn’t have an inbuilt log cleaner yet.
This is a problem because it will collapse a production server in time.

To address this, I wrote a custom python script that deletes old “*.log.gz” files.
As a template, I used this code, and for scheduled runs, I implemented the PyPI library APScheduler.
In the end, from my Dockerfile, I called torchserve and python script as background processes. Something like:

python ./log_cleaner.py &
torchserve start

Hope it helps,
Have a good one

Feel free to open an issue here GitHub - pytorch/serve: Serve, optimize and scale PyTorch models in production - sometimes it’s a diificult tradeoff for us to figure out what are common things we should support vs integrating with tools that do it better for you