Log rotation template change?

1. Output of caddy version:

v2.5.2 h1:eCJdLyEyAGzuQTa5Mh3gETnYWDClo1LjtQm2q9RNZrs=

2. How I run Caddy:

systemd

a. System environment:

Linux, LXC

b. Command:

caddy

d. My complete Caddy config:

Paste your config here, replacing this text.
Use `caddy fmt` to make it readable.
DO NOT REDACT anything except credentials.
LEAVE DOMAIN NAMES INTACT.
Make sure the backticks stay on their own lines.

{
debug
log {
output file /var/log/caddy/global.log {
roll_keep_for 14d
roll_size 1MiB
roll_uncompressed
}
level debug
}
# acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
# acme_dns acmedns /etc/acmedns/clientstorage.json
}

3. The problem I’m having:

Log rotation renames filenames from {LogName}.log, to like {LogName}-{timestamp}.log (as below) while I would like to change that to something like {LogName}.log-{Timestamp}

The reason for this, is using log fetchers like promtail, having multiple log files, it is great to have the log files named *.log and the rotated *.log-timestamp and then to match on *.log to logship. The problem with the caddy *-.log, is ater the rotation, the *-.log file is doubly imported/logshipped

-rw-r–r-- 1 caddy caddy 1048436 Sep 7 12:23 global-2022-09-07T12-23-12.813.log
-rw-r–r-- 1 caddy caddy 1048522 Sep 7 12:25 global-2022-09-07T12-25-12.849.log
-rw-r–r-- 1 caddy caddy 1047442 Sep 7 12:35 global-2022-09-07T12-35-12.922.log
drwxr-xr-x 2 caddy caddy 18 Sep 7 12:35 .
-rw-r–r-- 1 caddy caddy 520442 Sep 7 12:57 global.log

4. Error messages and/or full log output:

Paste logs/commands/output here.
USE THE PREVIEW PANE TO MAKE SURE IT LOOKS NICELY FORMATTED.

5. What I already tried:

REading the documentation, looking for the template for the filename

6. Links to relevant resources:

We’re using natefinch/lumberjack for log rolling. Looks like that’s not supported yet:

Surely you could run a cron or something that runs a bash script to rename the files according to the pattern you want :thinking: but that would probably break deleting the old rolled files, keep that in mind

A v3 of lumberjack is being worked on, but it doesn’t seem super active at the moment. Maybe you could offer a hand to implement the feature? If v3 gets stable-ish, we can switch to it in Caddy.

yeah, that explains ;(

if they just appended the TZ (much like most of the Log Rotates does it before the compression stage) it would’ve solved that problem one shot