playframework / playframework/play1
1.7.0: Logger.access() vs application.path="."
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.6k
- Forks
- 671
- Avg merge
- 12d 15h
- Merged PRs (30d)
- 1
Description
Play version 1.7.0, tested in DEV mode
Expected Behavior
Set application.path="." or do not set application.path (defaults to "."), application.log.path="/log4j.properties", log4j.properties exists in conf/ dir
-> logger config works
Actual Behavior
Logger.access() returns false, as absolute log4j.properties path does not start with "."
access() should be removed (I don't really see any benefit of access checking here, as someone who can modify the conf file has already breached the system anyway)
alternatively:
check against Play.applicationPath.getAbsolutePath().normalize()
Unfortunately it's not possible to work around this issue due to visibility of methods in Logger method -
one could use onConfigurationRead in a plugin to manually init Logger, effictively copy&pasting LOTS of code from Logger class OR set application.path to an absolute path, but both is a step back from previous behavior.
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 by reading the Play 1.7 Logger.access() implementation and the configuration path handling around application.path and application.log.path. Reproduce the case with application.path="." and conf/log4j.properties, then verify that logger initialization accepts the default relative application path without breaking access checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100