playframework / playframework/playframework
Dev mode server deletes application.log on startup
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 12.6k
- Forks
- 4k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 29
Description
Play Version (2.5.x / etc)
All Play 2.x
API (Scala / Java / Neither / Both)
Both
Expected Behavior
Play project developers should have an option not to delete application.log on every restart.
Actual Behavior
logs/application.log is deleted on each start, without the ability to disable this behavior or configure the filename.
Details
This was reported in Lagom (https://github.com/lagom/lagom/issues/533) and @jroper traced it back to code that was taken from Play's DevServerStart, originally introduced many years ago in https://github.com/playframework/playframework/commit/cdd8a71f2559bbbfa4c7d4cb93933a57399d3405#diff-5d88ec4ba69d14c245bd0ec3c50607ccR10
In Lagom, we're choosing to delete this code, and instead change the default dev mode Logback configuration to set append to false. This will preserve the behavior of deleting the file on start by default, while allowing users to turn this off or change the filename.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in framework/src/play-server/src/main/scala/play/core/server/DevServerStart.scala around lines 78-83, where the startup behavior was introduced. Trace how the dev server removes logs and how the Logback configuration is applied. Done means the default behavior is preserved while developers can disable deletion or configure the filename.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, scala
- Domain
- developer-experience
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100