The problem is that logrotate
will consider every new logfile with this custom name to be a separate entity to rotate (just like access_log
and error_log
would be handled separately if the file pattern would be /var/log/httpd/*log
). Thus, you will never get to 15 items to rotate.
One way around this might be with the maxage
option:
maxage count
Remove rotated logs older than days. The age is only checked if the logfile is to be rotated. The files
are mailed to the configured address if maillast and mail are configured.
but I am not sure if this really works.
If this doesn't work I would simply recommend to use a cron job that delete files older than 15 days matching your wildcard, as it appears that your app already uses a new log file every day.