Skip to content

Comments

add lumberjack log rotation#5696

Merged
WithoutPants merged 4 commits intostashapp:developfrom
feederbox826:logrotate
Nov 18, 2025
Merged

add lumberjack log rotation#5696
WithoutPants merged 4 commits intostashapp:developfrom
feederbox826:logrotate

Conversation

@feederbox826
Copy link
Collaborator

@feederbox826 feederbox826 commented Mar 3, 2025

Closes #5009
Related: #3692

Tested and working, still in draft for UI config of rotation size

@feederbox826
Copy link
Collaborator Author

feederbox826 commented Mar 5, 2025

not targeting 0.28 as iirc this is quite a niche feature and requires TRACE to generate anything substantial

edit: debug also does the job (came back to 10G logfile)

@feederbox826 feederbox826 marked this pull request as ready for review July 11, 2025 22:07
@feederbox826
Copy link
Collaborator Author

To generate a 1MB log file,

  • turn up log level to trace
  • log http access

fill up the log

  • go to a scene list
  • go to tags
  • repeat

1MB while reasonable, can generate excessive rotates. 10M is large enough to draw attention but not small enough to be triggered frequently to the point of annoyance even on trace
@WithoutPants
Copy link
Collaborator

This looks good, but I think it needs to be optional and turned off by default. Perhaps make the max log size value 0 by default, and when it is zero, the rolling log behaviour is zero. Having done a quick test, it zipped up my existing log file at startup, which is unexpected behaviour and probably not necessarily ideal for existing users. Some documentation in the manual might be worth doing as well to explain what it does (specifically what files it generates).

@feederbox826
Copy link
Collaborator Author

feederbox826 commented Nov 18, 2025

No longer rotates by default, you can test this with this lovingly crafted 1GB zip bomb
stash.log.zip

@WithoutPants WithoutPants added the feature Pull requests that add a new feature label Nov 18, 2025
@WithoutPants WithoutPants merged commit 78aeb06 into stashapp:develop Nov 18, 2025
2 checks passed
@feederbox826 feederbox826 deleted the logrotate branch November 18, 2025 03:07
@DogmaDragon DogmaDragon added this to the Version 0.30.0 milestone Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Pull requests that add a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Truncate & Archive Log Files

3 participants