When file compression is enabled and triggered (gz or zip) and the program exits before Logback can complete the compression, the full-sized tmp file and an incomplete archive are created.
I've included a sample minimal project that reproduces the bug. Basically, in the project, I have a script (creatively called reproduce-bug) that should replicate the situation I've described above. The script creates a 50 MB log file with random data, sets the modification time to yesterday, and runs an app (through Gradle) that appends to this log file. The app exits quickly, so Logback doesn't get a chance to finish compression.
A "workaround" for this issue is to make my program sleep until the compression ends.
Would it be feasible to keep the process alive until the Logback compression finishes somehow? Also, it might be worthwhile to add a note to the documentation to explain this caveat.