3

How can I set a rotating policy based on a disjunction of size and frequency criteria. I have tried the following:

"/var/log/uwsgi/*/*.log" {
  ...
  size 400M
  daily  rotate 14
  ..
}

However, even when logrotate is executed when the log file exceeds 400M of size, no rotation is being made.

Any idea how to force a rotation upon either condition?

Adam Matan
  • 12,519

1 Answers1

6

size is incompatible with the time-based settings, so when you specified daily after it, it was overruled. Try maxsize. From man logrotate:

maxsize size
      Log files are rotated when they grow bigger than size bytes even
      before the additionally specified time interval (daily,  weekly,
      monthly,  or yearly).  The related size option is similar except
      that it is mutually exclusive with the  time  interval  options,
      and  it  causes  log  files to be rotated without regard for the
      last rotation time.
muru
  • 197,895
  • 55
  • 485
  • 740