As Bojan Smojver reported (bug 171093), "extension" option is not working. The attached patch shall fix it. Thanks Bojan for reporting this problem.
Created attachment 120303 [details] Patch to fix "extension" option.
I think extension option works. I run "logrotate -vf rot" twice #cat rot extension .ext daily create rotate 5 somepath/foo.ext { } and i get $ ls foo* foo.1.ext foo.2.ext foo.ext
Now I see. I (and maybe also Bojan) thought about the config below: #cat rot extension .ext daily create rotate 5 somepath/foo { } and "logrotate -vf rot" twice would get: $ ls foo* foo foo.1.ext foo.2.ext So, if "somepath/foo.ext" was given, then no extension would be added because foo.ext already had ".ext" in name, and the result would be "foo.ext.1, foo.ext.2... But now I understand how it works. Maybe the option in man page needs to be better described.
This is what the manual page claims: extension ext Log files are given the final extension ext after rotation. If compression is used, the compression extension (normally .gz) appears after ext. From there, I was under the impression that the _rotated_ files will be given this extension, not that one needs to _have_ files with that extension in order for them to be rotated. If that was actually the desired behaviour, then the manual page should say: extension ext Log files with the extension ext can keep the extension after rotation. If compression is used, the compression extension (normally .gz) appears after ext. Then the manual page would actually match what logrotate does.