Problem with Rolling File Writer behavior
See original GitHub issueHi there,
I have an Issue with the Rolling File Write behavior.
In Tinylog 1.x the files get created by this schema if I setup 10MB filesize and 10 backups:
logfile.txt
logfile.1.txt
logfile.2.txt
[...]
logfile.10.txt
Tinylog 2.x creates the files via the following schema with the same settings:
logfile.0.txt (deleted)
logfile.1.txt (deleted)
logfile.2.txt (deleted)
[...]
logfile.50.txt (deleted)
logfile.51.txt
[...]
logfile.60.txt
In Tinylog 1.x I use this settings:
Configurator.defaultConfig()
.formatPattern("{date:yyyy-MM-dd HH:mm:ss} [{thread}] {class}.{method}()\\t{level}: {message}")
.writer(new RollingFileWriter("logs/aster_log.txt", 10, new CountLabeler(), new SizePolicy(10000 * 1024)))
.activate();
in Tinylog 2.x I use this settings:
writer = rolling file
writer.format = {date:yyyy-MM-dd HH:mm:ss} [{thread}] {class}.{method} {level}: {message}
writer.file = logs/APPNAME_log.{count}.txt
writer.charset = UTF-8
writer.policies = size: 10mb
writer.backups = 10
Could it be possible to change to 1.X behavior? This seems to be a more compatible option to Linux logrotate and is way more logical.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Problem with Rolling File Writer behavior · Issue #116 - GitHub
Hi there, I have an Issue with the Rolling File Write behavior. In Tinylog 1.x the files get created by this schema if...
Read more >Behavior changes in log4j 2.x - IBM
When this error occurs, the old log file is given a new name, and the existing one is overwritten. However, if there is...
Read more >log4j RollingFileAppender not writing to log until application ...
In my experience, this could very well just be your OS/filesystem/storage appliance/etc issue, or the application your using to view the file size, ......
Read more >Configuration - tinylog 2
The rolling file writer writes log entries to rolling log files. The log file can be defined as a pattern that will be...
Read more >[#LOG4J2-3317] After 2.17.1 upgarde, Route appenders with ...
When I check output file, its not writing the logs to Route File what we specify but general RollingFile logger appenders are working...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The backup naming behaviour that TinyLog v1 does is far more intuitive than v2, I agree with #116( issue comment ). TinyLog is really simple enough to use and fits all my needs, except this little change on v2 😃. Thank you for creating such a great logging framework.
You can find the reasons for the change here: https://github.com/pmwmedia/tinylog/issues/103#issuecomment-495292048
However, I could imagine to make the count placeholder configurable to get the old behavior if really needed.