nssm log rotation. How to limit files number

Viewed 19

I use NSSM to install and start my windows services. Also I trying to rotate log files by size and limit their count. Rotation by size was implemented, but I can not limit files count. Issue is that for a few time in log directory will be too much log files and this directory coud be to large. Currently I use below code to configure logs

nssm set SERVICE_NAME AppStdout "%OUTDIR%\logs\SERVICE_NAME\service.log"
nssm set SERVICE_NAME AppStderr "%OUTDIR%\logs\SERVICE_NAME\service-error.log"
nssm set SERVICE_NAME AppStdoutCreationDisposition 4
nssm set SERVICE_NAME AppStderrCreationDisposition 4
nssm set SERVICE_NAME AppRotateFiles 1
nssm set SERVICE_NAME AppRotateOnline 1
nssm set SERVICE_NAME AppRotateSeconds 0
nssm set SERVICE_NAME AppRotateBytes 100
nssm start SERVICE_NAME 

Is there way to say NSSM that I whant to store only N newest files?

0 Answers
Related