Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automatic control uwsgi log size

When my service run in uwsgi for a long time, the log file size grows very large. I want to find a way to automatic control the log size. For example, service in supervisor will cut into several pieces and it reserve the last 10 pieces.

like image 334
alexis Avatar asked Jan 01 '26 21:01

alexis


2 Answers

you need log-maxsize

[uwsgi]
;...
;...
log-maxsize = 2048
like image 147
doniyor Avatar answered Jan 03 '26 10:01

doniyor


You may also want to setup logrotate to keep backups for files (which you can have it compress the rotated log). http://linuxcommand.org/man_pages/logrotate8.html

like image 32
warath-coder Avatar answered Jan 03 '26 10:01

warath-coder



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!