Search code examples
javakotlintinylog

Rolling file in Tinylog overwrites a log file on every app start


I'm using the tinylog in version 2.6.2 in Kotlin. This is my tinylog.properties file:

writer2 = rolling file
writer2.level = info
writer2.file = #{tinylog.directory}/log_{date:yyyy-MM-dd}.{dynamic:Unknown}.txt
writer2.backups = 30
writer2.format = {date:yyyy-MM-dd HH:mm:ss} {level}: {message}
writer2.policies = daily, dynamic
writer2.charset = UTF-8

But tinylog creates overwrites the log file every time I start my application. Do you know why? And what can I do to force tinylog to append logs to the existsing log file until the day or my dynamic part change?


Solution

  • The issue with overwriting existing log files at startup when using the {dynamic} placeholder has been fixed in tinylog 2.7.0-M3.

    You can download the new version here: https://tinylog.org/v2/download-preview/