You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ppkarwasz (via GitHub)" <gi...@apache.org> on 2025/07/13 13:59:57 UTC

Re: [I] DirectWriteRolloverStrategy and SizeBasedTriggeringPolicy [logging-log4j2]

ppkarwasz commented on issue #3697:
URL: https://github.com/apache/logging-log4j2/issues/3697#issuecomment-3067064984

   Hi @Class-New,
   
   Apologies for the delayed response — we're doing our best to respond to all issues despite limited time, but occasionally some slip through the cracks.
   
   Thank you for your report!
   
   This behavior is actually expected and not a bug, but rather an implementation detail. As I explained in a [recent Stack Overflow answer](https://stackoverflow.com/a/79682036/11748454), Log4j Core enforces a 5 KiB limit on the **active** log file and rolls it over **after** that limit is exceeded. As a result, the rolled (archived) log file will contain the 5 KiB of existing log data **plus** the log event that triggered the rollover.
   
   That said, this behavior isn't set in stone. If you’d prefer the rollover to happen before writing the triggering event—so that it lands in the new log file—you’re welcome to open a PR with that change. We’d be happy to review it!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org