Description
The current default log rotation naming uses a zero-padded sequence number pattern (e.g., audit-log.jsonl → audit-log.002.jsonl → audit-log.003.jsonl).
We need to allow users to configure the rotation naming convention via a template string passed to Rotate() or Log configuration.
Proposed Approach
Add a LogOption or configuration that accepts a template string with variables like:
{{.Base}} - original filename without extension
{{.Ext}} - file extension
{{.Seq}} - zero-padded sequence number
{{.Timestamp}} - rotation timestamp
{{.PrevPath}} - previous log path
Example template: "{{.Base}}.{{.Seq}}{{.Ext}}"
Acceptance Criteria
Related
Description
The current default log rotation naming uses a zero-padded sequence number pattern (e.g.,
audit-log.jsonl→audit-log.002.jsonl→audit-log.003.jsonl).We need to allow users to configure the rotation naming convention via a template string passed to
Rotate()orLogconfiguration.Proposed Approach
Add a
LogOptionor configuration that accepts a template string with variables like:{{.Base}}- original filename without extension{{.Ext}}- file extension{{.Seq}}- zero-padded sequence number{{.Timestamp}}- rotation timestamp{{.PrevPath}}- previous log pathExample template:
"{{.Base}}.{{.Seq}}{{.Ext}}"Acceptance Criteria
LogConfigstruct or option function forNewLog{{.Base}}.{{.Seq}}{{.Ext}})docs/rotation.mdRelated