BUG/MINOR: log: limit the size of the startup-logs

This is an alternative to mainline commit 869efd5eeb ("BUG/MINOR: log:
make "show startup-log" use a ring buffer instead"). Instead of relying
on a log buffer, it limits the size of logs to bufsize. This avoids
taking O(N^2) time to start up in case a large config produces many
warnings. Typically a 100k backend config with one warning each could
take roughly 20 minutes just to produce the message which in the end
was not retrievable over the CLI, while now it takes roughly 0.5s.

The commit mentioned above requires backporting the ring infrastructure
which seems overkill just to fix this.

This must be backported to 1.9.
1 file changed