apache / apache/logging-log4j2

CronTrigerringPolicy date

Open
#2,721 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
3.6k
Forks
1.7k
Avg merge
21h 30m
Merged PRs (30d)
27

Description

Hello, below is my login configuration file, the main assumptions are:
- maximum 5 logs per day, 20 MB each
- deleting logs older than 21 days
- log backup every day at midnight


${sys:user.home}/.test/logs





%msg





















According to the assumption, I would like the log backup to include the date of log creation, i.e. if I create a log on July 8, 2024, the log backup should contain the name 'console-2024-07-08_1.log' and it creates a backup with the date from the previous day (console -2024-07-07_1.log). After changing the logging policy and replacing CronTriggeringPolicy with the entry ``, it logs the correct date, but I would like to have more control over it, so I want to use CronTriggeringPolicy. Please help me find what could be the cause.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the XML RollingFile configuration with CronTriggeringPolicy and compare its rollover date with the TimeBasedTriggeringPolicy configuration shown in the issue. Trace how CronTriggeringPolicy selects the rollover timestamp and verify the result against the expected console-2024-07-08_1.log naming; done means the configured cron rollover uses the log creation date as requested.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
observability-sre
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.